diff --git a/build/installer/change_ip.sh b/build/installer/change_ip.sh index 71c154e1..349780ea 100644 --- a/build/installer/change_ip.sh +++ b/build/installer/change_ip.sh @@ -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" @@ -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 @@ -414,7 +440,10 @@ main() { fi fi - update_juicefs + if [[ $(is_wsl) -eq 0 ]]; then + update_juicefs + fi + update_etcd if is_k3s ; then