From b31155c54ce5381a12b36812f452ffbf844328b6 Mon Sep 17 00:00:00 2001 From: Preston Brown Date: Fri, 1 Jun 2001 20:12:33 +0000 Subject: check link status before trying DHCP/BOOTP. --- sysconfig/network-scripts/network-functions | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sysconfig/network-scripts/network-functions') diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index ee65bd61..fdd4a211 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -81,6 +81,20 @@ check_device_down () return $retcode } +check_link_down () +{ + if [ -x /sbin/mii-tool ]; then + output=`/sbin/mii-tool $1 2>&1` + if echo $output | grep -q "Operation not supported"; then + return 0 + elif echo $output | grep -q "link ok"; then + return 0 + else + return 1 + fi + fi + return 0 +} check_default_route () { -- cgit v1.2.1