aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-07-26 21:08:20 +0000
committerBill Nottingham <notting@redhat.com>2001-07-26 21:08:20 +0000
commit9a89c6d693c914f6cec6e18b86b4f18edd089829 (patch)
tree946ee1b653513dc1a58409f406ea64ba1b4b8f4d /sysconfig/network-scripts
parentc8a973a3fd0e3a6c24bdf07adb0d70abbabb5a6a (diff)
downloadinitscripts-9a89c6d693c914f6cec6e18b86b4f18edd089829.tar
initscripts-9a89c6d693c914f6cec6e18b86b4f18edd089829.tar.gz
initscripts-9a89c6d693c914f6cec6e18b86b4f18edd089829.tar.bz2
initscripts-9a89c6d693c914f6cec6e18b86b4f18edd089829.tar.xz
initscripts-9a89c6d693c914f6cec6e18b86b4f18edd089829.zip
- only bring link down if check_link_down fails
- add a sleep in check_link_down; some cards take time to negotiate - only expand_config for the static IP case in ifdown
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifdown3
-rwxr-xr-xsysconfig/network-scripts/ifup1
-rw-r--r--sysconfig/network-scripts/network-functions4
3 files changed, 4 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 3ccf4547..8a80161a 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -52,8 +52,6 @@ if [ "${NETWORKING_IPV6}" = "yes" ]; then
/etc/sysconfig/network-scripts/ifdown-ipv6 ${CONFIG}
fi
-expand_config
-
retcode=0
if [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then
[ -n "`pidof -x dhcpcd`" ] && {
@@ -65,6 +63,7 @@ if [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then
retcode=$?
}
else
+ expand_config
ip addr del ${IPADDR}/${PREFIX} brd ${BROADCAST:-+} dev ${DEVICE}
fi
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 2f61aca1..cad5edcb 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -149,6 +149,7 @@ if [ -n "${DYNCONFIG}" ]; then
echo -n $"Determining IP information for ${DEVICE}..."
if check_link_down ${DEVICE}; then
echo $" failed; no link present. Check cable?"
+ ip link set down ${DEVICE} >/dev/null 2>&1
exit 1
fi
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index f4d7a130..995f3f95 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -120,9 +120,9 @@ check_device_down ()
check_link_down ()
{
if [ -x /sbin/mii-tool ]; then
- ip link set $1 up >/dev/null 2>&1
+ LC_ALL=C ip link show $1 2>/dev/null| grep -q UP || ip link set $1 up >/dev/null 2>&1
+ sleep 2
output=`LC_ALL=C /sbin/mii-tool $1 2>&1`
- ip link set $1 down >/dev/null 2>&1
if echo $output | grep -q "Operation not supported"; then
return 1
elif echo $output | grep -q "link ok"; then