Skip to content

Commit

Permalink
fix: change ip for wsl (#223)
Browse files Browse the repository at this point in the history
Co-authored-by: liuyu <>
  • Loading branch information
eball authored Jul 18, 2024
1 parent 425facf commit 3e32281
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion build/installer/change_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ is_k3s(){
}

precheck_os() {
# check os type and arch and os vesion
os_type=$(uname -s)
os_arch=$(uname -m)
os_verion=$(lsb_release -d 2>&1 | awk -F'\t' '{print $2}')

case "$os_arch" in
x86_64) ARCH=amd64; ;;
armv7l) ARCH=arm; ;;
aarch64) ARCH=arm64; ;;
ppc64le) ARCH=ppc64le; ;;
s390x) ARCH=s390x; ;;
*) echo "unsupported arch, exit ...";
exit -1; ;;
esac

# try to resolv hostname
ensure_success $sh_c "hostname -i >/dev/null"

Expand All @@ -98,6 +113,17 @@ precheck_os() {
local_ip="$ip"
}

is_wsl(){
wsl=$(uname -a 2>&1)
if [[ ${wsl} == *WSL* ]]; then
echo 1
return
fi

echo 0
}


regen_cert_conf(){
old_IFS=$IFS
for pem in $1 ; do
Expand Down Expand Up @@ -414,7 +440,10 @@ main() {
fi
fi

update_juicefs
if [[ $(is_wsl) -eq 0 ]]; then
update_juicefs
fi

update_etcd

if is_k3s ; then
Expand Down

0 comments on commit 3e32281

Please sign in to comment.