IPADDR=`/sbin/ip addr show dev ${GW} | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1`
if [ -z "${IPADDR}" ]; then
# device doesn't seem to have an IP address
IPADDR=`/sbin/ip addr show dev ${GW} | grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1`
if [ -z "${IPADDR}" ]; then
# device doesn't seem to have an IP address