|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!亚太区域收集信息纪录在这里,天天都有更新。
http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
上面这个剧本将对这段文本举行编纂,输入国际几年夜运营商网段。
#!/bin/sh
#autogettheIPTable
#getthenewestdelegated-apnic-latest
rmdelegated-apnic-latest
iftypewget
thenwgethttp://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
elsefetchhttp://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
fi
grepapnic|CN|ipv4delegated-apnic-latest|cut-f4,5-d||tr||whilereadipcnt
do
mask=$(bc<<END|tail-1
pow=32;
definelog2(x){
if(x<=1)return(pow);
pow--;
return(log2(x/2));
}
log2($cnt);
END
)
echo$ip/$mask;>>cnnet
resultext=`whois$ip@whois.apnic.net|grep-e^netname-e^descr-e^role-e^mnt-by|cut-f2-d:|seds/*//`
ifecho$resultext|grep-i-erailcom-ecrtc-erailway
thenecho$ip/$mask;>>crc
elifecho$resultext|grep-i-ecncgroup-enetcom
thenecho$ip/$mask;>>cnc
elifecho$resultext|grep-i-echinanet-echinatel
thenecho$ip/$mask;>>telcom_acl
elifecho$resultext|grep-i-eunicom
thenecho$ip/$mask;>>unicom
elifecho$resultext|grep-i-ecmnet
thenecho$ip/$mask;>>cmnet
else
echo$ip/$mask;>>other_acl
fi
done
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们! |
|