hi,
please point out what's wrong with my script. im feeding it a list containing fqdn, sit should ssh into each and verify that atleast one of its virtual backup ip resolves into one of its virtual hostnames .. anyway the objective shows in the script... however, im having problems in the
innermost if condition.. "else" wont get executed.
#!/bin/bash -x
for i in `cat $1`
do
_HOSTNAME=`echo $i |cut -d"." -f1`
/usr/bin/ssh $i "
echo $_HOSTNAME;
for i in `/sbin/ifconfig -a | grep 172\.39 | awk '{print $2}'`
do
if [[ -n `nslookup $i | grep $_HOSTNAME | awk '{print $2}'` ]]
then echo "backup interface OK"
else echo "backup interface NOT OK"
fi
done
" >> $1.out 2>/dev/null
done
TIA!