标签:ip归属地查询
#!/bin/bash ipp(){ exec < $1 while read a do string1=`curl -s "http://www.ip138.com/ips138.asp?ip=${a}&action=2"|iconv -f gb2312 -t utf-8|grep ‘<ul class="ul1"><li>‘ | awk -F ‘[<>]+‘ ‘{print substr($5,7)}‘` echo $a echo -e "\033[44;37;5m $string1 \033[0m" done } case $1 in -f) shift ipp $1 ;; -i) shift string1=`curl -s "http://www.ip138.com/ips138.asp?ip=${1}&action=2"| iconv -f gb2312 -t utf-8 |grep ‘<ul class="ul1"><li>‘ | awk -F ‘[<>]+‘ ‘{print substr($5,7)}‘` echo $1 echo -e "\033[44;37;5m $string1 \033[0m" ;; *) echo "[Help] $0 need -f or -i -f ------ argument is a file -i ------ argument is a IP [For example]: $0 -f filename $0 -f ipaddress " ;; esac
本文出自 “linux_cheng” 博客,请务必保留此出处http://6764097.blog.51cto.com/6754097/1615434
标签:ip归属地查询
原文地址:http://6764097.blog.51cto.com/6754097/1615434