From 28657ce8e220ed2b10c5277ad4e1d6846f181185 Mon Sep 17 00:00:00 2001 From: Akatsukiro Date: Thu, 18 Jan 2024 16:29:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AF=B9=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E7=B3=BB=E7=BB=9F=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/install.sh b/install.sh index 624f6ec..498edce 100644 --- a/install.sh +++ b/install.sh @@ -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