#! /bin/sh
echo "" > socksresult.txt
for line in `cat socks5`
do
#echo $line
rtt=`curl -m 5 --socks5 $line -w %{time_total}s -o null google.com`
if [ $? -ne 0 ]; then
echo $line" fail"
else
country=`curl -m 5 --socks5 $line ipinfo.io | grep country | awk '{print $2}' | sed "s/\"//g" | sed "s/,//g"`
loc=`curl -m 5 --socks5 $line ipinfo.io | grep region | awk '{print $2}' | sed "s/\"//g" | sed "s/,//g"`
speed=`curl --socks5 $line -o null -w %{speed_download} -s http://speedtest.wdc01.softlayer.com/downloads/test10.zip`
speedk=`echo "($speed+0.5)/1024" | bc`
info=$line" "$rtt" "$country" "$loc" "$speedk"KB/s"
echo $info >> socksresult.txt
fi
done
结果
1.2.2.1:1080 0.544s VN Hanoi 539KB/s
2.2.2.2:1080 3.870s IL Central 881KB/s
2.3.3.3:1080 1.713s TR Bursa 1375KB/s
echo "" > socksresult.txt
for line in `cat socks5`
do
#echo $line
rtt=`curl -m 5 --socks5 $line -w %{time_total}s -o null google.com`
if [ $? -ne 0 ]; then
echo $line" fail"
else
country=`curl -m 5 --socks5 $line ipinfo.io | grep country | awk '{print $2}' | sed "s/\"//g" | sed "s/,//g"`
loc=`curl -m 5 --socks5 $line ipinfo.io | grep region | awk '{print $2}' | sed "s/\"//g" | sed "s/,//g"`
speed=`curl --socks5 $line -o null -w %{speed_download} -s http://speedtest.wdc01.softlayer.com/downloads/test10.zip`
speedk=`echo "($speed+0.5)/1024" | bc`
info=$line" "$rtt" "$country" "$loc" "$speedk"KB/s"
echo $info >> socksresult.txt
fi
done
结果
1.2.2.1:1080 0.544s VN Hanoi 539KB/s
2.2.2.2:1080 3.870s IL Central 881KB/s
2.3.3.3:1080 1.713s TR Bursa 1375KB/s
评论
发表评论