diff options
-rwxr-xr-x | sysconfig/network-scripts/ifdown-eth | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth index 503bbe72..bc34f856 100755 --- a/sysconfig/network-scripts/ifdown-eth +++ b/sysconfig/network-scripts/ifdown-eth @@ -36,9 +36,9 @@ check_device_down ${DEVICE} && [ "$BOOTPROTO" != "dhcp" -a "$BOOTPROTO" != "boot if [ -n "${HWADDR}" -a -z "${MACADDR}" ]; then FOUNDMACADDR=`get_hwaddr ${REALDEVICE}` - if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then + if [ -n "${FOUNDMACADDR}" -a "${FOUNDMACADDR}" != "${HWADDR}" ]; then NEWCONFIG=`LANG=C grep -il "^[[:space:]]*HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*` - if [ -n "${NEWCONFIG}" -a "${NEWCONFIG}" != "${CONFIG}" ]; then + if [ -n "${NEWCONFIG}" -a "${NEWCONFIG##*/}" != "${CONFIG##*/}" ]; then exec /sbin/ifdown ${NEWCONFIG} else echo $"Device ${DEVICE} has different MAC address than expected, ignoring." @@ -79,7 +79,7 @@ else fi if [ "${REALDEVICE}" = "${DEVICE}" ]; then - ip link set dev ${DEVICE} down + ip link set dev ${DEVICE} down 2>/dev/null fi [ "$retcode" = "0" ] && retcode=$? |