diff options
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r-- | sysconfig/network-scripts/network-functions | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 605c19db..d3cf86ef 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -131,6 +131,7 @@ check_device_down () check_mii_tool () { + [ -x /sbin/mii-tool ] || return 2 output=`LC_ALL=C mii-tool $1 2>&1` echo $output | LC_ALL=C grep -q "link ok" && return 1 echo $output | LC_ALL=C grep -q "no link" && return 0 || return 2 @@ -138,6 +139,7 @@ check_mii_tool () check_ethtool () { + [ -x /sbin/ethtool ] || return 2 output=`LC_ALL=C ethtool $1 2>&1` echo $output | LC_ALL=C grep -q "Link detected: yes" && return 1 echo $output | LC_ALL=C grep -q "Link detected: no" && return 0 || return 2 @@ -146,7 +148,7 @@ check_ethtool () check_link_down () { - if [ -x /sbin/mii-tool ]; then + if [ -x /sbin/mii-tool -o -x /sbin/ethtool ]; then if ! LC_ALL=C ip link show $1 2>/dev/null| grep -q UP ; then ip link set $1 up >/dev/null 2>&1 timeout=0 @@ -164,9 +166,10 @@ check_link_down () usleep 500000 timeout=$((timeout+1)) done + return 0 fi fi - return 0 + return 1 } check_default_route () |