Update fixed_windows.sh

This commit is contained in:
spiritlhl 2023-09-16 22:57:58 +08:00 committed by GitHub
parent 1ff28f20e4
commit 15f0a81970
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,9 @@ fi
if [ ! -d /usr/local/bin ]; then
mkdir -p /usr/local/bin
fi
if [ ! -d /usr/local/bin/Geco-Cloudbase-Init ]; then
mkdir -p /usr/local/bin/Geco-Cloudbase-Init
fi
check_china() {
_yellow "IP area being detected ......"
@ -85,7 +88,7 @@ check_cdn_file() {
fi
}
apt-get install git patch -y
apt-get install unzip patch -y
# ChinaIP检测
check_china
@ -108,11 +111,13 @@ fi
# https://github.com/GECO-IT/Geco-Cloudbase-Init
# https://forum.proxmox.com/threads/howto-scripts-to-make-cloudbase-work-like-cloudinit-for-your-windows-based-instances.103375/
if [[ -z "${CN}" || "${CN}" != true ]]; then
cd /usr/local/bin/ && git clone git@github.com:GECO-IT/Geco-Cloudbase-Init.git
cd /root >/dev/null 2>&1
wget https://github.com/GECO-IT/Geco-Cloudbase-Init/archive/refs/heads/master.zip
unzip master.zip
mv Geco-Cloudbase-Init-master/* /usr/local/bin/Geco-Cloudbase-Init/
else
cd /usr/local/bin/ && git clone "${cdn_success_url}https://github.com/GECO-IT/Geco-Cloudbase-Init.git"
cd /root >/dev/null 2>&1
wget "${cdn_success_url}https://github.com/GECO-IT/Geco-Cloudbase-Init/archive/refs/heads/master.zip"
unzip master.zip
mv Geco-Cloudbase-Init-master/* /usr/local/bin/Geco-Cloudbase-Init/
fi
# 识别是否可替换对应版本镜像