From 5dc155ea81911686f74cd3bb27d7f752ac4c8428 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 2 Aug 2001 18:14:48 +0000 Subject: do the same thing for ifdown too --- sysconfig/network-scripts/ifdown | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index 8a80161a..9ff1cfde 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -48,6 +48,24 @@ fi # Check to make sure the device is actually up check_device_down ${DEVICE} && exit 0 +if [ -n "${HWADDR}" ]; then + FOUNDMACADDR=`LC_ALL= LANG= ip -o link show ${REALDEVICE} | \ + sed 's/.*link\/ether \([[:alnum:]:]*\).*/\1/'` + if [ "${FOUNDMACADDR}" != "${HWADDR}" ]; then + NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/network-scripts/ifcfg-*` + if [ -n "${NEWCONFIG}" ]; then + exec /sbin/ifdown ${NEWCONFIG} + fi + NEWCONFIG=`fgrep -l "HWADDR=${HWADDR}" /etc/sysconfig/networking/default/ifcfg-*` + if [ -n "${NEWCONFIG}" ]; then + exec /sbin/ifdown ${NEWCONFIG} + else + echo $"Device ${DEVICE} has different MAC address than expected, ignoring." + exit 1 + fi + fi +fi + if [ "${NETWORKING_IPV6}" = "yes" ]; then /etc/sysconfig/network-scripts/ifdown-ipv6 ${CONFIG} fi -- cgit v1.2.1