aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2000-03-08 16:20:36 +0000
committerBill Nottingham <notting@redhat.com>2000-03-08 16:20:36 +0000
commita3761f9b1480fb6bcd6710600c0056cef721ebcc (patch)
treee1a35ec5f6a03c5ba8c1ee73fe48798ea83c3ea9 /sysconfig
parented8fc799706e61e663d87cc4fd17c6455c22390b (diff)
downloadinitscripts-a3761f9b1480fb6bcd6710600c0056cef721ebcc.tar
initscripts-a3761f9b1480fb6bcd6710600c0056cef721ebcc.tar.gz
initscripts-a3761f9b1480fb6bcd6710600c0056cef721ebcc.tar.bz2
initscripts-a3761f9b1480fb6bcd6710600c0056cef721ebcc.tar.xz
initscripts-a3761f9b1480fb6bcd6710600c0056cef721ebcc.zip
check that a device is up before bringing it down
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifdown3
-rw-r--r--sysconfig/network-scripts/network-functions2
2 files changed, 4 insertions, 1 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index 5018e708..a00c8949 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -36,6 +36,9 @@ if [ -x $OTHERSCRIPT ]; then
exec $OTHERSCRIPT $CONFIG $2
fi
+# Check to make sure the device is actually up
+check_device_down && exit 0
+
if [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then
pump -r -i ${DEVICE}
fi
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index d2b254d4..42fb72be 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -51,7 +51,7 @@ set_hostname()
check_device_down ()
{
- if ifconfig ${DEVICE} | grep UP >/dev/null 2>&1 ; then
+ if ifconfig ${DEVICE} 2>/dev/null | grep UP >/dev/null 2>&1 ; then
retcode=1
else
retcode=0