blob: d7b894e259abe91a4b6aad63d5909e6247c2cc77 [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
5ME=$(ifconfig | grep "10\.3\.[0-9]\.[0-9]" | sed -e 's/.*addr:\(10\.3\.[0-9]\.[0-9]\).*/\1/g' 2> /dev/null)
6echo "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