feat: 添加对操作系统的判断

This commit is contained in:
Akatsukiro 2024-01-18 16:29:10 +08:00
parent ad64dc29f8
commit 28657ce8e2
Signed by: Akatsukiro
GPG Key ID: 93F1D32999999999

View File

@ -24,6 +24,24 @@ pre_check() {
echo os_arch: ${os_arch}
# check os type and os version
if [ -f /etc/os-release ]; then
source /etc/os-release
if [[ $ID == "debian" ]]; then
systemFlag="1"
elif [[ $ID == "ubuntu" ]]; then
systemFlag="2"
elif [[ $ID == "centos"|| $ID == "rocky" || $ID == "alma" || $ID_LIKE == "rhel" ]]; then
systemFlag="3"
else
echo "您的操作系统为 $ID ,这是不支持的操作系统"
exit 1
fi
else
echo "无法判断系统信息"
exit 1
fi
## China_IP
if [[ -z "${CN}" ]]; then
if [[ $(curl -m 10 -s https://ipapi.co/json | grep 'China') != "" ]]; then