check for eth1 before using it

Former-commit-id: d4d1e1e140
This commit is contained in:
mjames-upc 2015-04-11 07:39:09 -06:00
parent b9e35db23b
commit 88ab1218eb

View file

@ -70,7 +70,9 @@ IP=`/sbin/ifconfig $usedev | grep "inet addr" | awk '{ print $2 }' | cut -d: -f
if [[ $IP =~ ^10\..* || $IP =~ ^192\.168.* ]] # non-routable IP range
then
IP=`/sbin/ifconfig eth1 | grep "inet addr" | awk '{ print $2 }' | cut -d: -f2`
if [[ $ethdev =~ eth1 ]]; then
IP=`/sbin/ifconfig eth1 | grep "inet addr" | awk '{ print $2 }' | cut -d: -f2`
fi
elif [[ $IP =~ ^172\..* ]]
then
IPb=`echo $IP | cut -d"." -f2`