#!/bin/bash # #Grab the sites we'll be working with: # #grep ServerName /web/conf/httpd.conf | grep -v # | sed -e 's/www\.//g' # #Generate the list of IPs from the old box that we're checking against: # #ifconfig | grep addr | grep -v -e HWaddr -e Memory -e inet6 -e 172.16.14.200 -e 127.0.0.1 | cut -d":" -f2 | awk '{print $1}' # #To generate the URL list: # #for i in `cat urls`; do echo "$i -- `dig A $i | grep ANSWER -A1 | tail -1 | awk '{print $5}' | sed -e '/^$/d'`"; done | grep -v "\-\- $" | grep -v cname | sed -e 's/ \-\-//g' | awk '{print $1}' > urllist # # #To generate the IP list: # #for i in `cat urls`; do echo "$i -- `dig A $i | grep ANSWER -A1 | tail -1 | awk '{print $5}' | sed -e '/^$/d'`"; done | grep -v "\-\- $" | grep -v cname | sed -e 's/ \-\-//g' | awk '{print $2}' > iplist wc="0" for i in `seq 0 63`; do for j in `head -$(($i +1)) urllist| tail -1`; do url[$i]="$j"; done; done for i in `seq 0 63`; do for j in `head -$(($i +1)) iplist| tail -1`; do ip[$i]="$j"; done; done while [ `echo $wc` -le "63" ] do if [ `grep ${ip[$wc]} w2 | wc -l` -ne 0 ] then echo "$wc -- ${url[$wc]} ${ip[$wc]} on epubvirt" echo "${url[$wc]} ${ip[$wc]}" >> urlsonepubvirt wc=$(($wc +1)) else echo "$wc -- ${url[$wc]} ${ip[$wc]} on w2" echo "${url[$wc]} ${ip[$wc]}" >> urlsonw2 wc=$(($wc +1)) fi done