| NODES="10.X.1.1 10.X.1.2 10.X.2.1 10.X.2.2 10.X.1.254 10.X.2.254 8.8.8.8" |
| ifconfig $u > /dev/null 2>&1 |
| LIST="-$USE_IFACE $NODES - 8.8.8.8" |
| if [ ! -z $USE_IFACE ]; then |
| FROM=$(ifconfig $USE_IFACE | grep "inet addr" | head -1 | awk '{print $2}' | cut -d: -f2) |
| if [ "$FROM" != "none" ]; then |
| X=$(echo "$FROM" | cut -d. -f2) |
| LIST=$(echo $LIST | sed -e "s/X/$X/g") |
| echo "from $(hostname) ($FROM):" |
| if [ "$ip" == "-" ]; then |
| ILABEL="$(echo $ip | sed -e 's/^-//g')" |
| printf " %-20s%s\n" "$ip ($ILABEL)" $(ping $IFACE -c 1 $ip 2>&1 | grep "^rtt min/avg/max/mdev" | sed -e 's/.*= \([.0-9]*\).*/\1/') |