标签:dig 统计域名加速
#!/bin/bash
#author yeqing <492980936@qq.com>
#date 2015-07-19 10:26:28
yesNum=0
noNum=0
i=0
data=‘‘
yesList=()
noList=()
date=`date +"%Y-%m-%d %H:%M"`
while read url; do
dig ${url}|egrep ‘cloudglb.net|hacdn.net|hadns.net‘ > /dev/null 2>&1
if [ $? -eq 0 ]; then
yesList[$i]=${url}
yesNum=`expr ${yesNum} + 1`
else
noList[$i]=${url}
noNum=`expr ${noNum} + 1`
fi
let i++
done < url.txt
for noUrl in ${noList[*]};do
data="(‘${date}‘,‘${noUrl}‘,0,${yesNum},${noNum}),${data}"
done
for yesUrl in ${yesList[*]};do
data="(‘${date}‘,‘${yesUrl}‘,1,${yesNum},${noNum}),${data}"
done
mysql -h 192.168.1.5 -uroot -p"123456" -s -e "insert into test.fastglb(time,domain,flag,yes,no) values${data%,*}";
本文出自 “技术屌丝” 博客,谢绝转载!
标签:dig 统计域名加速
原文地址:http://yeqing.blog.51cto.com/3159086/1676070