diff options
author | Bill Nottingham <notting@redhat.com> | 2001-08-02 18:14:48 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2001-08-02 18:14:48 +0000 |
commit | 5dc155ea81911686f74cd3bb27d7f752ac4c8428 (patch) | |
tree | cc266de296af192970ff43d1cf004f143bb0d82a /sysconfig | |
parent | 4243ae04d6a405affb743bec9a1e72637ef60e67 (diff) | |
download | initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar.gz initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar.bz2 initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.tar.xz initscripts-5dc155ea81911686f74cd3bb27d7f752ac4c8428.zip |
do the same thing for ifdown too
Diffstat (limited to 'sysconfig')
-rwxr-xr-x | sysconfig/network-scripts/ifdown | 18 |
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 |