diff --git a/find_best_cdn_ip.sh b/find_best_cdn_ip.sh index dea852f..a0fb6e1 100755 --- a/find_best_cdn_ip.sh +++ b/find_best_cdn_ip.sh @@ -97,25 +97,12 @@ init(){ pingTool } checkSystem(){ - - if [[ ! -z `find /etc -name "redhat-release"` ]] || [[ ! -z `cat /proc/version | grep -i "centos" | grep -v grep ` ]] || [[ ! -z `cat /proc/version | grep -i "red hat" | grep -v grep ` ]] || [[ ! -z `cat /proc/version | grep -i "redhat" | grep -v grep ` ]] - then - release="centos" - installType='yum -y install' - removeType='yum -y remove' - upgrade="yum update -y --skip-broken" - elif [[ ! -z `cat /etc/issue | grep -i "debian" | grep -v grep` ]] || [[ ! -z `cat /proc/version | grep -i "debian" | grep -v grep` ]] + if [[ "`uname`" = "Darwin" ]] then - release="debian" - installType='apt -y install' - upgrade="apt update -y" - removeType='apt -y autoremove' + release="Darwin" elif [[ ! -z `cat /etc/issue | grep -i "ubuntu" | grep -v grep` ]] || [[ ! -z `cat /proc/version | grep -i "ubuntu" | grep -v grep` ]] then release="ubuntu" - installType='apt -y install' - upgrade="apt update -y" - removeType='apt --purge remove' fi if [[ -z ${release} ]] then