list="法兰克福,50.3.75.98,http://ffm.lg.virmach.com/100MB.test
水牛城,107.173.176.5,http://ny.lg.virmach.com/100MB.test
达拉斯,23.95.41.200,http://dal.lg.virmach.com/100MB.test
洛杉矶,23.94.228.141,http://la.lg.virmach.com/100MB.test
芝加哥,170.130.139.3,http://chi.lg.virmach.com/100MB.test
凤凰城,173.213.69.188,http://phx.lg.virmach.com/100MB.test
西雅图,104.140.22.36,http://sea.lg.virmach.com/100MB.test
亚特兰大,107.172.25.131,http://atl.lg.virmach.com/100MB.test
纽约市,107.174.64.68,http://nj.lg.virmach.com/100MB.test
圣何塞,107.172.96.135,http://sj.lg.virmach.com/100MB.test"
list="法兰克福(德国),,http://fra-de-ping.vultr.com/vultr.com.1000MB.bin
巴黎(法国),,http://par-fr-ping.vultr.com/vultr.com.1000MB.bin
阿姆斯特丹(荷兰),,http://ams-nl-ping.vultr.com/vultr.com.1000MB.bin
伦敦(英国),,http://lon-gb-ping.vultr.com/vultr.com.1000MB.bin
纽约(美国),,http://nj-us-ping.vultr.com/vultr.com.1000MB.bin
芝加哥(美国),,http://il-us-ping.vultr.com/vultr.com.1000MB.bin
亚特兰大(美国),,http://ga-us-ping.vultr.com/vultr.com.1000MB.bin
迈阿密(美国),,http://fl-us-ping.vultr.com/vultr.com.1000MB.bin
达拉斯(美国),,http://tx-us-ping.vultr.com/vultr.com.1000MB.bin
西雅图(美国),,http://wa-us-ping.vultr.com/vultr.com.1000MB.bin
硅谷(美国),,http://sjo-ca-us-ping.vultr.com/vultr.com.1000MB.bin
洛杉矶(美国),,http://lax-ca-us-ping.vultr.com/vultr.com.1000MB.bin
悉尼(澳大利亚),,http://syd-au-ping.vultr.com/vultr.com.1000MB.bin
东京(日本),,http://hnd-jp-ping.vultr.com/vultr.com.1000MB.bin"
while true; do
echo -e "\n\n"
date
for i in $list; do
IFS_SAVED="$IFS" IFS="," f=( $i ) IFS="$IFS_SAVED";
echo -e "\n${f[0]} ${f[1]}";
sudo ping -c 1000 -f $( echo "${f[2]}" | grep -oE "[a-z.-]+.com" | head -n 1 ) | grep -oE -e "PING.+" -e "[0-9]+% packet loss.*" -e "rtt.+";
timeout 120 curl -O "${f[2]}";
done;
done
网友评论