blob: 4bbcef93274ec974bb39c6572d2efec08780c20b [file] [log] [blame]
David K. Bainbridge317e7d72016-05-11 08:31:44 -07001#!/bin/bash
2
3HOSTS="10.3.1.1 10.3.1.2 10.3.2.1 10.3.2.2 10.3.1.254 10.3.2.254 192.168.10.1 8.8.8.8"
4
David K. Bainbridge6e23ac82016-12-07 12:55:41 -08005ME=$(ifconfig | grep "10\.3\.[0-9]\.[0-9]" | sed -e 's/.*addr:\(10\.3\.[0-9]\.[0-9]\).*/\1/g' 2> /dev/null)
David K. Bainbridge317e7d72016-05-11 08:31:44 -07006echo "FROM: $ME"
7for TO in $HOSTS; do
8 T=$(ping -q -c 1 -W 1 -I eth0 $TO | grep rtt | awk '{print $4}' | sed -e 's|/| |g') #sed -e 's|r| |')
9 echo "$TO: $T" | awk '{printf(" %-15s %-7s\n", $1, $2, $3, $4)}'
10done