Created
August 20, 2015 03:07
-
-
Save toooonyy/90d64eba2df5b2b10fd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# this use ip.cn and ip.com | |
ip=`mtr -rn $1 -c 1|awk '$2 ~ "[12]?[0-9]?[0-9]\.[12]?[0-9]?[0-9]\.[12]?[0-9]?[0-9]\.[12]?[0-9]?[0-9]"{print $2}'` | |
echo -e 'IP\t\t\tip.cn\t\t\tip.com' | |
for i in $ip | |
do | |
echo -e $i'\t\t\c' | |
curl -s "http://ip.cn/index.php?ip="$i | awk -F "来自:" '{printf $2"\t\t"}' | |
curl -s "ip138.com/ips138.asp?ip="$i | iconv -f gbk -t utf-8 | grep class=\"ul1\" |awk -F "本站主数据:" '{print $2}'| awk -F "<" '{print $1}' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment