千家信息网

查询ip归属地的shell脚本

发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,#!/bin/bashipp(){exec < $1while read adostring1=`curl -s "http://www.ip138.com/ips138.asp?ip=${a}&ac
千家信息网最后更新 2024年09月22日查询ip归属地的shell脚本
#!/bin/bashipp(){exec < $1while read adostring1=`curl -s "http://www.ip138.com/ips138.asp?ip=${a}&action=2"|iconv -f gb2312 -t utf-8|grep '
  • ' | awk -F '[<>]+' '{print substr($5,7)}'`echo $aecho -e "\033[44;37;5m $string1 \033[0m"done}case $1 in-f)shiftipp $1;;-i)shiftstring1=`curl -s "http://www.ip138.com/ips138.asp?ip=${1}&action=2"| iconv -f gb2312 -t utf-8 |grep '
    • ' | awk -F '[<>]+' '{print substr($5,7)}'`echo $1echo -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


0