aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifdown-eth
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-02-28 20:21:39 +0000
committerBill Nottingham <notting@redhat.com>2006-02-28 20:21:39 +0000
commit90004e3f54a4f58aa7a415781b0a0824fb9d7eb2 (patch)
tree456af7f6e6b73165404dc66902134c69a08b97d9 /sysconfig/network-scripts/ifdown-eth
parent8b5fcc00b7d4d0ab44618a4db8a6d146cd65c747 (diff)
downloadinitscripts-90004e3f54a4f58aa7a415781b0a0824fb9d7eb2.tar
initscripts-90004e3f54a4f58aa7a415781b0a0824fb9d7eb2.tar.gz
initscripts-90004e3f54a4f58aa7a415781b0a0824fb9d7eb2.tar.bz2
initscripts-90004e3f54a4f58aa7a415781b0a0824fb9d7eb2.tar.xz
initscripts-90004e3f54a4f58aa7a415781b0a0824fb9d7eb2.zip
don't cause the module to get reloaded on ifdown if it's not loaded
(#179809)
Diffstat (limited to 'sysconfig/network-scripts/ifdown-eth')
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth16
1 files changed, 9 insertions, 7 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index 1150f098..55c02fbd 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -77,14 +77,16 @@ retcode=0
# may have been changed in the config file since the device was
# brought up. Flush all addresses associated with this
# instance instead.
-if [ "${REALDEVICE}" = "${DEVICE}" ]; then
- ip addr flush dev ${REALDEVICE} 2>/dev/null
-else
- ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null
-fi
+if [ -d "/sys/class/net/${REALDEVICE}" ]; then
+ if [ "${REALDEVICE}" = "${DEVICE}" ]; then
+ ip addr flush dev ${REALDEVICE} 2>/dev/null
+ else
+ ip addr flush dev ${REALDEVICE} label ${DEVICE} 2>/dev/null
+ fi
-if [ "${REALDEVICE}" = "${DEVICE}" ]; then
- ip link set dev ${DEVICE} down 2>/dev/null
+ if [ "${REALDEVICE}" = "${DEVICE}" ]; then
+ ip link set dev ${DEVICE} down 2>/dev/null
+ fi
fi
[ "$retcode" = "0" ] && retcode=$?