File: conn6

package info (click to toggle)
hobbit-plugins 20100527
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 196 kB
  • ctags: 32
  • sloc: perl: 1,080; makefile: 49; sh: 43
file content (24 lines) | stat: -rwxr-xr-x 645 bytes parent folder | download | duplicates (2)
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