--- net.eth0.orig 2003-11-08 11:04:50.000000000 -0800 +++ net.eth0 2003-11-08 10:55:17.000000000 -0800 @@ -33,6 +33,7 @@ inet6_IFACE="$(eval echo \$\{inet6_${iface}\})" alias_IFACE="$(eval echo \$\{alias_${iface}\})" status_IFACE="$(ifconfig | gawk -v IFACE="${iface}" '/Link/ { if ($1 == IFACE) print "up" }')" + carrier_IFACE="$(ifconfig | gawk -v IFACE="${iface}" '/RUNNING/ { if ($1 == IFACE) print "running" }')" vlans="$(eval echo \$\{iface_${IFACE}_vlans\})" } @@ -63,11 +64,18 @@ # Check that eth0 was not brough up by the kernel ... if [ "${status_IFACE}" != "up" ] then - /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || { - retval=$? - eend ${retval} "Failed to bring ${IFACE} up" - return ${retval} - } + # Check that the interface has a carrier + if [ "${carrier_IFACE}" == "running" ] + then + /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || { + retval=$? + eend ${retval} "Failed to bring ${IFACE} up" + return ${retval} + } + else + eend 1 "${IFACE} is not plugged in or has no carrier signal" + return 1 + fi fi fi