Dig Statistics domain acceleration

Source: Internet
Author: User

#!/bin/bash
#author yeqing <[email protected]>
#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[*]};d o
Data= "(' ${date} ', ' ${nourl} ', 0,${yesnum},${nonum}), ${data}"
Done
For Yesurl in ${yeslist[*]};d o
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%,*}";

This article from "Technical Cock silk" blog, declined reprint!

Dig Statistics domain acceleration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.