rendered paste body#!/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}' > iplistwc="0"for i in `seq 0 63`; do for j in `head -$(($i +1)) urllist| tail -1`; do url[$i]="$j"; done; donefor i in `seq 0 63`; do for j in `head -$(($i +1)) iplist| tail -1`; do ip[$i]="$j"; done; donewhile [ `echo $wc` -le "63" ]doif [ `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))fidone