From a8c48a5fe35dda4e6004edcbdc3a62f343a9340a Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Fri, 31 Jul 2020 10:00:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=9F=A5=E6=89=BE=E6=9C=80=E4=BC=98ip):?= =?UTF-8?q?=20=E5=85=BC=E5=AE=B9Mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- find_best_cdn_ip.sh | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) 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