From 96a8374a35cae5e4f25f306637e0e80ce2d3019f Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 27 Jun 2002 18:37:22 +0000 Subject: switch this back; we don't want to report non-existent aliases as up --- sysconfig/network-scripts/network-functions | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'sysconfig') diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 42384882..30665628 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -121,15 +121,18 @@ set_hostname() check_device_down () { - # never say alias devices are down - if echo $1 | grep -q ':'; then + if echo $1 | grep -q ':' ; then + if LC_ALL=C ifconfig -a 2>/dev/null | grep -q $1 ; then + return 1 + else + return 0 + fi + else + if LC_ALL=C ip -o link ls dev $1 2>/dev/null | grep ",UP" >/dev/null 2>&1 ; then return 1 - fi - - if LC_ALL=C ip -o link ls dev $1 2>/dev/null | grep -q UP ; then - return 1 - else + else return 0 + fi fi } @@ -137,7 +140,7 @@ check_link_down () { if [ -x /sbin/mii-tool ]; then LC_ALL=C ip link show $1 2>/dev/null| grep -q UP || ip link set $1 up >/dev/null 2>&1 - # wait for link to come up + # wait for link to come up sleep 2 /sbin/mii-tool >/dev/null 2>&1 || return 1 output=`LC_ALL=C /sbin/mii-tool $1 2>&1` -- cgit v1.2.1