From 7d9ae36edd5903f70e1f3a20c62ef48910fe36bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=83=96?= <5607346+xiaopang0v0@user.noreply.gitee.com> Date: Fri, 14 May 2021 09:13:31 +0800 Subject: [PATCH] =?UTF-8?q?Add=20single=20ip=20speed=20measurement=20under?= =?UTF-8?q?=20Linux=EF=BC=88=E4=B8=80=E4=B8=AALinux=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E5=8D=95ip=E6=B5=8B=E9=80=9F=E8=84=9A=E6=9C=AC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shell/speedtest.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 shell/speedtest.sh diff --git a/shell/speedtest.sh b/shell/speedtest.sh new file mode 100644 index 0000000..988f38b --- /dev/null +++ b/shell/speedtest.sh @@ -0,0 +1,10 @@ +#!/bin/bash +rm -rf data.txt log.txt +curl -s --ipv4 --resolve service.udpfile.com:443:$resolveip --retry 3 "https://service.udpfile.com?asn="$asn"&city="$city"" -o data.txt >> /dev/null +domain=$(cat data.txt | grep domain= | cut -f 2- -d'=') +file=$(cat data.txt | grep file= | cut -f 2- -d'=') +url=$(cat data.txt | grep url= | cut -f 2- -d'=') +echo "请输入你要检测的CloudFlare IP" +read ip +curl --resolve $domain:443:$ip https://$domain/$file -o /dev/null --connect-timeout 5 --max-time 10 +rm -rf data.txt log.txt