hw-test/scripts/test-ping

21 lines
411 B
Bash
Executable file

#!/bin/bash
source scan-netdev
for VLAN in {401..408} ; do
if [[ -f /etc/netdev/vlan.$VLAN.csv ]] ; then
VLAN_CONF=`grep $SERVER_SERIAL \
/etc/netdev/vlan.$VLAN.csv`
fi
if [[ -z $VLAN_CONF ]] ; then
continue
fi
IP_LIST=`cat /etc/netdev/vlan.$VLAN.csv \
| cut -d ',' -f 3 \
| grep '^[0-9]' | sort`
for IP in $IP_LIST; do
echo -n "$IP - "
ping -c5 -f $IP | grep 'received'
done
done