Changeset 7 in lab


Ignore:
Timestamp:
Jun 30, 2009 10:50:47 PM (15 years ago)
Author:
mitty
Message:
  • abort if fail to bind IP address to NIC
    • no DHCPd, disconnecting cables, etc...
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/iproute/setroute.sh

    r6 r7  
    2929# get IP address, network mask, default gateway info 
    3030IPADDR=`/sbin/ip addr show dev ${IFACE} | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1` 
     31if [ -z ${IPADDR} ]; then 
     32    # fail to bind IP address to device 
     33    echo "${IFACE} has no IP address." 
     34    exit 
     35fi 
    3136NETWORK=`/sbin/ip route show dev ${IFACE} | grep -w ${IPADDR} | cut -d ' ' -f 1` 
    3237 
Note: See TracChangeset for help on using the changeset viewer.