add checks on network device

This commit is contained in:
encrypt 2015-03-25 01:21:52 +01:00
parent c063a703e4
commit 03ff316131

View file

@ -4,6 +4,16 @@ STATE=0
source ~/.etherswitch
if [ -z "$interface" ]
then
echo "interface is not set"
exit 1
fi
# check if $interface is a network device
ip link show $interface > /dev/null
if [ $? -eq 1 ]; then exit 1; fi
while :
do
ip link show $interface | grep -q "LOWER_UP"