aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-02-07 22:25:58 +0000
committerBill Nottingham <notting@redhat.com>2005-02-07 22:25:58 +0000
commit244ef0ad3ae0a79c3e038a05acb6735c2cf55b57 (patch)
tree4c59eac9084d67c494148f0f4c72288f316b2a33
parent71f79940ffdf9b128adf59c5d8cbc18df1ebde8f (diff)
downloadinitscripts-244ef0ad3ae0a79c3e038a05acb6735c2cf55b57.tar
initscripts-244ef0ad3ae0a79c3e038a05acb6735c2cf55b57.tar.gz
initscripts-244ef0ad3ae0a79c3e038a05acb6735c2cf55b57.tar.bz2
initscripts-244ef0ad3ae0a79c3e038a05acb6735c2cf55b57.tar.xz
initscripts-244ef0ad3ae0a79c3e038a05acb6735c2cf55b57.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 d4a35086..703a1120 100755
--- a/sysconfig/network-scripts/ifdown
+++ b/sysconfig/network-scripts/ifdown
@@ -60,9 +60,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."
@@ -118,7 +118,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=$?