aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-02-07 22:26:11 +0000
committerBill Nottingham <notting@redhat.com>2005-02-07 22:26:11 +0000
commit7409e1177b7c6681f9024b610c6cf72a88b46904 (patch)
tree4f4e70e4404cc10e7c079fb727a2b0200b4760e3
parent27dbc54672a8d88f2283cae5af06c2a8b3e267ec (diff)
downloadinitscripts-7409e1177b7c6681f9024b610c6cf72a88b46904.tar
initscripts-7409e1177b7c6681f9024b610c6cf72a88b46904.tar.gz
initscripts-7409e1177b7c6681f9024b610c6cf72a88b46904.tar.bz2
initscripts-7409e1177b7c6681f9024b610c6cf72a88b46904.tar.xz
initscripts-7409e1177b7c6681f9024b610c6cf72a88b46904.zip
handle being called on down devices better
-rwxr-xr-xsysconfig/network-scripts/ifdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown
index a2f17b31..3b97a4c6 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -51,9 +51,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."
@@ -99,7 +99,7 @@ if ! [ "$BOOTPROTO" = bootp -o "$BOOTPROTO" = dhcp ]; then
fi
if [ "${REALDEVICE}" = "${DEVICE}" ]; then
- ip link set dev ${DEVICE} down
+ ip link set dev ${DEVICE} down 2>/dev/null
fi
[ "$retcode" = "0" ] && retcode=$?