--- net.eth0.old 2003-11-17 15:13:53.000000000 +0100 +++ net.eth0 2003-11-19 09:54:45.000000000 +0100 @@ -32,8 +32,7 @@ dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${iface}\})" 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" }')" + status_IFACE="$(ifconfig ${iface} | gawk '/UP/ { print "up" }')" vlans="$(eval echo \$\{iface_${IFACE}_vlans\})" } @@ -62,8 +61,15 @@ # Check that eth0 was not brough up by the kernel ... if [ "${status_IFACE}" != "up" ] then + # Bring up the interface to enable check for carrier + /sbin/ifconfig ${IFACE} up >/dev/null || { + retval=$? + eend ${retval} "Failed to bring ${IFACE} up" + return ${retval} + } # Check that the interface has a carrier - if [ "${carrier_IFACE}" = "running" ] + /sbin/ifconfig ${IFACE} |grep -q 'RUNNING' >/dev/null + if [ $? -eq 0 ] then /sbin/dhcpcd ${dhcpcd_IFACE} ${IFACE} >/dev/null || { retval=$? @@ -71,6 +77,7 @@ return ${retval} } else + /sbin/ifconfig ${IFACE} down >/dev/null eend 1 "${IFACE} is not plugged in or has no carrier signal" return 1 fi