diff options
Diffstat (limited to 'sysconfig')
-rw-r--r-- | sysconfig/network-scripts/network-functions | 21 |
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 () |