ha.d/haresources & bonding

#!/bin/bash
#Show status for bonded IPs currently listed in /etc/ha.d/haresources
 
#We only want the second word (seq +2) through to the final four
#words (seq -4) in our haresources
cnt=`wc -w /etc/ha.d/haresources | cut -d" " -f1`
acnt=$(echo " $cnt - 4 " | bc -l)
 
addr=$(for i in `seq 2 $acnt` ;
do /bin/cat /etc/ha.d/haresources | cut -d" " -f$i | tr '\n' ' ' ;
done)
 
y=$(for x in $addr;
do echo $x | sed 's/IPaddr:://' ;
done)
 
for z in $y;
do echo " " ;
echo "Status for $z";
/etc/ha.d/resource.d/IPaddr2 $z status ;
done
 
echo " "
echo "Completed status for $acnt bonded address"
echo " "