慕田峪3266474
2019-01-20
qq_你的朋友_0
2018-09-12
没有好办法,只能是crontab脚本定时reload一次 。reload不影响服务器都,只是加载配置文件。Q 531317590
chanlang
2018-08-06
wget使用大写的O
慕仔7147015
2018-05-25
# script for getting smart dns IP database
FILE=/opt/apnic/ip_apnic
if [ ! -e $FILE ];then
wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest -O $FILE
fi
rm -f cn.net chinanet unicom cmcc others
grep 'apnic|CN|ipv4|' $FILE | cut -f4,5 -d '|' |sed -e 's/|/ /g' | while read ip cnt
do
echo $ip:$cnt
mask=$(cat << EOF | bc | tail -1
pow=32;
define log2(x) {
if (x <= 1) return (pow);
pow--;
return (log2(x/2));
}
log2($cnt)
EOF
)
echo $ip/$mask>> cn.net
if whois $ip | grep "netname" | grep -i ".*chinanet.*\|.*telecom.*" > /dev/null;then
echo $ip/$mask>> chinanet
elif whois $ip | grep "netname" | grep -i ".*unicom.*" >> /dev/null;then
echo $ip/$mask>> unicom
elif whois $ip | grep "netname" | grep -i ".*chinamobile.*" >> /dev/null;then
echo $ip/$mask>> cmcc
else
echo $ip/$mask>> others
fi
done
Jeson
2018-03-13
Longingforthesun
2017-08-02
不是很懂,这应该不是shell的语法吧
田心枫
2017-03-18
怎么说呢,dns服务器这方面你要先了解,我也不是很清楚
慕粉183037419
2017-03-18
还好吧。多看看就会了
玫瑰宝宝的天空
2017-02-26
可以使用ping检测