summaryrefslogtreecommitdiff
path: root/check_ip
blob: f9330c0f1c4b364b278d27e9c5c99c8c1e012097 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e
set -x
GREP=""
# if an argument is specified, use that to grep for this as a role
if [ "$1" != "" ]; then
	GREP="|grep $1"
fi
# lava-group is tab separated
for line in `lava-group $GREP | cut -f1` ; do
	# get the ipv4 for this device
	STR=`lava-network query $line ipv4`
	# strip off the prefix for ipv4
	DUT=`echo $STR | sed -e 's/^addr://'`
	ping -c1 -W1 ${IP}
done