From d2047d29ac7cd499aea038347f41f0e062853bdb Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Tue, 11 Aug 2020 11:59:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(find=20best=20cdn=20ip):=20=E5=85=BC?= =?UTF-8?q?=E5=AE=B9debian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- find_best_cdn_ip.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/find_best_cdn_ip.sh b/find_best_cdn_ip.sh index 12bb26f..43ec348 100755 --- a/find_best_cdn_ip.sh +++ b/find_best_cdn_ip.sh @@ -56,7 +56,7 @@ pingTool(){ pingResult=`ping -c ${num} -W ${timeout} ${ip[$i]}` packetLoss=`echo ${pingResult}|awk -F "[%]" '{print $1}'|awk -F "[p][a][c][k][e][t][s][ ][r][e][c][e][i][v][e][d][,][ ]" '{print $2}'` roundTrip=`echo ${pingResult}|awk -F "[r][o][u][n][d][-][t][r][i][p]" '{print $2}'|awk '{print $3}'|awk -F "[/]" '{print $1"."$2"."$3"."$4}'|awk -F "[/]" '{print $1$2$3$4}'|awk -F "[.]" '{print $1" "$3" "$5" "$7}'` - if [[ "${release}" = "ubuntu" ]] + if [[ "${release}" = "ubuntu" ]] || [[ "${release}" = "debian" ]] then packetLoss=`echo ${pingResult}|awk -F "[%]" '{print $1}'|awk -F "[r][e][c][e][i][v][e][d][,][ ]" '{print $2}'` roundTrip=`echo ${pingResult}|awk -F "[r][t][t]" '{print $2}'|awk '{print $3}'|awk -F "[/]" '{print $1"."$2"."$3"."$4}'|awk -F "[/]" '{print $1$2$3$4}'|awk -F "[.]" '{print $1" "$3" "$5" "$7}'` @@ -114,6 +114,9 @@ checkSystem(){ elif [[ ! -z `cat /etc/issue | grep -i "ubuntu" | grep -v grep` ]] || [[ ! -z `cat /proc/version | grep -i "ubuntu" | grep -v grep` ]] then release="ubuntu" + elif [[ ! -z `cat /etc/issue | grep -i "debian" | grep -v grep` ]] || [[ ! -z `cat /proc/version | grep -i "debian" | grep -v grep` ]] + then + release="debian" fi if [[ -z ${release} ]] then