查询ip归属地的shell脚本

#!/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 '
  • ' | 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 '
  • ' | 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

  • 文章标题:查询ip归属地的shell脚本
    文章链接:http://csruizhi.cn/article/gphejc.html

    其他资讯

    Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
    友情链接: 成都定制网站建设 营销型网站建设 成都定制网站建设 成都网站制作 成都网站建设 重庆网站制作 手机网站制作 手机网站建设套餐 企业网站设计 成都网站设计 响应式网站建设 品牌网站建设 网站制作公司 营销型网站建设 四川成都网站建设 网站建设 企业网站制作 企业网站建设 成都网站设计 成都网站制作 高端网站设计推广 成都网站建设