fix(脚本): 修改判断时兼容小写

pull/534/merge
mack-a 2021-01-15 15:46:40 +08:00
parent 60c295278b
commit 797b2df8a5
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
# ------------------------------------------------------------- # -------------------------------------------------------------
# 检查系统 # 检查系统
checkSystem() { checkSystem() {
if [[ -n $(find /etc -name "redhat-release") ]] || grep </proc/version -q "centos"; then if [[ -n $(find /etc -name "redhat-release") ]] || grep </proc/version -q -i "centos"; then
centosVersion=$(rpm -q centos-release | awk -F "[-]" '{print $3}' | awk -F "[.]" '{print $1}') centosVersion=$(rpm -q centos-release | awk -F "[-]" '{print $3}' | awk -F "[.]" '{print $1}')
if [[ -z "${centosVersion}" ]] && grep </etc/centos-release "release 8"; then if [[ -z "${centosVersion}" ]] && grep </etc/centos-release "release 8"; then
@ -14,7 +14,7 @@ checkSystem() {
# removeType='yum -y remove' # removeType='yum -y remove'
upgrade="yum update -y --skip-broken" upgrade="yum update -y --skip-broken"
elif grep </etc/issue -q "debian" && [[ -f "/etc/issue" ]] || grep </etc/issue -q "debian" && [[ -f "/proc/version" ]]; then elif grep </etc/issue -q -i "debian" && [[ -f "/etc/issue" ]] || grep </etc/issue -q -i "debian" && [[ -f "/proc/version" ]]; then
if grep </etc/issue -i "8"; then if grep </etc/issue -i "8"; then
debianVersion=8 debianVersion=8
fi fi
@ -23,7 +23,7 @@ checkSystem() {
upgrade="apt update -y" upgrade="apt update -y"
# removeType='apt -y autoremove' # removeType='apt -y autoremove'
elif grep </etc/issue -q "ubuntu" && [[ -f "/etc/issue" ]] || grep </etc/issue -q "ubuntu" && [[ -f "/proc/version" ]]; then elif grep </etc/issue -q -i "ubuntu" && [[ -f "/etc/issue" ]] || grep </etc/issue -q -i "ubuntu" && [[ -f "/proc/version" ]]; then
release="ubuntu" release="ubuntu"
installType='apt-get -y install' installType='apt-get -y install'
upgrade="apt-get update -y" upgrade="apt-get update -y"