aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-08-02 18:14:48 +0000
committerBill Nottingham <notting@redhat.com>2001-08-02 18:14:48 +0000
commit5dc155ea81911686f74cd3bb27d7f752ac4c8428 (patch)
treecc266de296af192970ff43d1cf004f143bb0d82a
parent4243ae04d6a405affb743bec9a1e72637ef60e67 (diff)
downloadinitscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar
initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar.gz
initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar.bz2
initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar.xz
initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.zip
do the same thing for ifdown too
-rwxr-xr-xsysconfig/network-scripts/ifdown18
1 files changed, 18 insertions, 0 deletions
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