From 904283504950ec379197f569429127c0feba08bb Mon Sep 17 00:00:00 2001 From: badafans <990508464@qq.com> Date: Mon, 10 Jan 2022 15:46:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96RTT=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/cf.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shell/cf.sh b/shell/cf.sh index e8458d8..15d217a 100644 --- a/shell/cf.sh +++ b/shell/cf.sh @@ -62,7 +62,6 @@ do curl --resolve www.cloudflare.com:443:$ip https://www.cloudflare.com/cdn-cgi/trace -o /dev/null -s --connect-timeout 1 -w "$ip"_%{time_connect}_"HTTP"%{http_code}"\n">>rtt/$1-$n.log t=$[$t+1] else - ipaddr=$(cat rtt/$1-$n.log | awk 'NR==1' | awk -F_ '{print $1}') getrtt=$(grep HTTP200 rtt/$1-$n.log | wc -l) if [ $getrtt == 0 ] then @@ -80,12 +79,12 @@ do getrtt=5-getrtt if [ $avgms -lt 10 ] then - echo $getrtt 00$avgms $ipaddr>rtt/$1-$n.log + echo $getrtt 00$avgms $ip>rtt/$1-$n.log elif [ $avgms -ge 10 ] && [ $avgms -lt 100 ] then - echo $getrtt 0$avgms $ipaddr>rtt/$1-$n.log + echo $getrtt 0$avgms $ip>rtt/$1-$n.log else - echo $getrtt $avgms $ipaddr>rtt/$1-$n.log + echo $getrtt $avgms $ip>rtt/$1-$n.log fi n=$[$n+1] t=1