aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-09-26 20:15:51 +0000
committerBill Nottingham <notting@redhat.com>2001-09-26 20:15:51 +0000
commit06ac00230b734f60e075b4902e911523ef37a396 (patch)
tree36ec0aea74d8cd02959f288151f0dbe4d0e5db31 /sysconfig/network-scripts/ifdown
parentc9a5053823d1a907ec0546c05cca520713de3e41 (diff)
downloadinitscripts-06ac00230b734f60e075b4902e911523ef37a396.tar
initscripts-06ac00230b734f60e075b4902e911523ef37a396.tar.gz
initscripts-06ac00230b734f60e075b4902e911523ef37a396.tar.bz2
initscripts-06ac00230b734f60e075b4902e911523ef37a396.tar.xz
initscripts-06ac00230b734f60e075b4902e911523ef37a396.zip
some more DEVICE -> REALDEVICE changes; flush all addresses on bringing down main device
Diffstat (limited to 'sysconfig/network-scripts/ifdown')
-rwxr-xr-xsysconfig/network-scripts/ifdown8
1 files changed, 6 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index c9b03c85..ffe1d80a 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -37,7 +37,7 @@ if [ -x /sbin/ifdown-pre-local ]; then
fi
DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"`
-REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`
+[ -z "$REALDEVICE" ] && REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`
OTHERSCRIPT="/etc/sysconfig/network-scripts/ifdown-${DEVICETYPE}"
if [ -x $OTHERSCRIPT ]; then
@@ -87,7 +87,11 @@ else
# may have been changed in the config file since the device was
# brought up. Flush all addresses associated with this
# instance instead.
- ip addr flush dev ${REALDEVICE} label ${DEVICE}
+ if [ "${REALDEVICE}" = "${DEVICE}" ]; then
+ ip addr flush dev ${REALDEVICE} 2>/dev/null
+ else
+ ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null
+ fi
fi
if [ "${REALDEVICE}" = "${DEVICE}" ]; then