diff options
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 |