From 188c903e0fe0ff947986a6b14952603682e19a3a Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Sun, 9 Feb 2003 04:40:41 +0000 Subject: fix check_device_down (#83780, ) --- sysconfig/network-scripts/network-functions | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sysconfig') 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 () -- cgit v1.2.1