aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-02-15 12:13:27 -0500
committerBill Nottingham <notting@redhat.com>2010-02-15 12:13:27 -0500
commita21eb994804e40f920d0e83afd2a4ec9b8c60c33 (patch)
tree8896db24c2c68a3e59d1cdcb891b548412f97b86
parent7c3320462b065fa1b405e9d64bab66511bbcb0d7 (diff)
downloadinitscripts-a21eb994804e40f920d0e83afd2a4ec9b8c60c33.tar
initscripts-a21eb994804e40f920d0e83afd2a4ec9b8c60c33.tar.gz
initscripts-a21eb994804e40f920d0e83afd2a4ec9b8c60c33.tar.bz2
initscripts-a21eb994804e40f920d0e83afd2a4ec9b8c60c33.tar.xz
initscripts-a21eb994804e40f920d0e83afd2a4ec9b8c60c33.zip
Don't use ethtool to check link ; operate on the carrier sysfs attribute.
-rw-r--r--sysconfig/network-scripts/network-functions21
1 files changed, 1 insertions, 20 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 475d42a0..61a9ee40 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -244,18 +244,8 @@ check_device_down ()
fi
}
-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
-}
-
-
check_link_down ()
{
- if [ -x /sbin/ethtool ]; then
if ! LC_ALL=C ip link show dev $1 2>/dev/null| grep -q ",UP" ; then
ip link set dev $1 up >/dev/null 2>&1
fi
@@ -263,20 +253,11 @@ check_link_down ()
delay=10
[ -n "$LINKDELAY" ] && delay=$(($LINKDELAY * 2))
while [ $timeout -le $delay ]; do
- check_ethtool $1
- e=$?
- if [ $e -eq 1 ] ; then
- return 1
- fi
- if [ $e -eq 2 ] ; then
- return 1
- fi
+ [ "$(cat /sys/class/net/$REALDEVICE/carrier 2>/dev/null)" = "1" ] && return 1
usleep 500000
timeout=$((timeout+1))
done
return 0
- fi
- return 1
}
check_default_route ()