check for eth1 before using it
This commit is contained in:
parent
5e4a9dd749
commit
d4d1e1e140
1 changed files with 3 additions and 1 deletions
|
@ -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`
|
||||
|
|
Loading…
Add table
Reference in a new issue