1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/bin/sh
# To enable IPv6 connectivity tests, add the "conn6" tag to bb-hosts.
bbhostgrep conn6 | cut -d ' ' -f 2 | fping6 -e | while read host line ; do
case $line in
is?alive*) color="green"
TIME=`echo "$line" | perl -ne 'if (/\(([\d.]+) ?us/) { printf "%f", $1/1000000 }
elsif (/\(([\d.]+) ?ms/) { printf "%f", $1/1000 }
elsif (/\(([\d.]+)/) { print $1 }'`
;;
*) color="red"
if bbhostgrep conn6 | grep $host | grep -q dialup ; then
color="clear"
fi
;;
esac
( echo "status $host.conn6 $color `date`"
host -t AAAA $host
echo
echo "&$color $host $line"
echo "Seconds: $TIME"
) | bb $BBDISP @
done
|