* no DHCPd, disconnecting cables, etc...
git-svn-id: https://lab.mitty.jp/svn/lab/trunk@7
7d2118f6-f56c-43e7-95a2-
4bb3031d96e7
# get IP address, network mask, default gateway info
IPADDR=`/sbin/ip addr show dev ${IFACE} | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1`
+if [ -z ${IPADDR} ]; then
+ # fail to bind IP address to device
+ echo "${IFACE} has no IP address."
+ exit
+fi
NETWORK=`/sbin/ip route show dev ${IFACE} | grep -w ${IPADDR} | cut -d ' ' -f 1`
if [ -z "${GATEWAY}" ]; then