diff options
author | Bill Nottingham <notting@redhat.com> | 2001-09-26 20:33:53 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2001-09-26 20:33:53 +0000 |
commit | 9ec96fbd11123f5b7531e9cc0681ae5b7a0a1b38 (patch) | |
tree | 973f4f3273caa5da5248bfa1385e48aa63a81e7b /sysconfig/network-scripts/ifdown | |
parent | 35b744c27dd1387f2eb5f3a357fcc2dfa047dc14 (diff) | |
download | initscripts-9ec96fbd11123f5b7531e9cc0681ae5b7a0a1b38.tar initscripts-9ec96fbd11123f5b7531e9cc0681ae5b7a0a1b38.tar.gz initscripts-9ec96fbd11123f5b7531e9cc0681ae5b7a0a1b38.tar.bz2 initscripts-9ec96fbd11123f5b7531e9cc0681ae5b7a0a1b38.tar.xz initscripts-9ec96fbd11123f5b7531e9cc0681ae5b7a0a1b38.zip |
some more DEVICE -> REALDEVICE changes; flush all addresses on bringing down main device
Diffstat (limited to 'sysconfig/network-scripts/ifdown')
-rwxr-xr-x | sysconfig/network-scripts/ifdown | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index 4dea40ed..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} 2>/dev/null + 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 |