diff options
author | Bill Nottingham <notting@redhat.com> | 2003-02-09 04:40:41 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2003-02-09 04:40:41 +0000 |
commit | 188c903e0fe0ff947986a6b14952603682e19a3a (patch) | |
tree | 4b708ce8b9769e2edf30d05829e4378fbae16916 /sysconfig/network-scripts | |
parent | d91dcafa8098bb63fb01e8533138304f4c8fcbb4 (diff) | |
download | initscripts-188c903e0fe0ff947986a6b14952603682e19a3a.tar initscripts-188c903e0fe0ff947986a6b14952603682e19a3a.tar.gz initscripts-188c903e0fe0ff947986a6b14952603682e19a3a.tar.bz2 initscripts-188c903e0fe0ff947986a6b14952603682e19a3a.tar.xz initscripts-188c903e0fe0ff947986a6b14952603682e19a3a.zip |
fix check_device_down (#83780, <pzb@datastacks.com>)
Diffstat (limited to 'sysconfig/network-scripts')
-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 () |