查询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脚本
    网页URL:http://csruizhi.cn/article/gphejc.html

    其他资讯

    Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
    友情链接: 手机网站制作 网站建设改版 四川成都网站设计 成都网站设计 网站制作 高端网站设计 网站制作 重庆网站制作 成都品牌网站设计 成都网站制作 网站制作公司 营销型网站建设 上市集团网站建设 成都网站制作 外贸营销网站建设 定制网站建设多少钱 成都定制网站建设 网站建设 高端品牌网站建设 app网站建设 高端网站建设 成都网站建设公司