aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-02-14 21:04:16 +0000
committerBill Nottingham <notting@redhat.com>2005-02-14 21:04:16 +0000
commitb49c37365122a0f3f450be2aebff776fdc21afd4 (patch)
treef792546c28755dbcd1b62e8c43e3593e148d3959
parent20bf4ded18fe0f6405da76585bad4219a6ee5468 (diff)
downloadinitscripts-b49c37365122a0f3f450be2aebff776fdc21afd4.tar
initscripts-b49c37365122a0f3f450be2aebff776fdc21afd4.tar.gz
initscripts-b49c37365122a0f3f450be2aebff776fdc21afd4.tar.bz2
initscripts-b49c37365122a0f3f450be2aebff776fdc21afd4.tar.xz
initscripts-b49c37365122a0f3f450be2aebff776fdc21afd4.zip
dhcp release cleanups (<jvdias@redhat.com>)
-rwxr-xr-xsysconfig/network-scripts/ifdown-eth11
1 files changed, 8 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth
index bc34f856..a9570c01 100755
--- a/sysconfig/network-scripts/ifdown-eth
+++ b/sysconfig/network-scripts/ifdown-eth
@@ -58,14 +58,19 @@ fi;
retcode=0
[ -n "`pidof -x dhclient`" ] && {
if [ -f "/var/run/dhclient-${DEVICE}.pid" ]; then
+ dhcpid=`cat /var/run/dhclient-${DEVICE}.pid`
if [[ "$DHCPRELEASE" = [yY1]* ]]; then
/sbin/dhclient -r -lf /var/lib/dhcp/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid ${DEVICE} >/dev/null 2>&1
+ retcode=$?
else
+ kill $dhcpid >/dev/null 2>&1
+ retcode=$?
reason=STOP interface=${DEVICE} /sbin/dhclient-script
fi
- kill `cat /var/run/dhclient-${DEVICE}.pid` >/dev/null 2>&1
- retcode=$?
- rm -f /var/run/dhclient-${DEVICE}.pid
+ if [ -f "/var/run/dhclient-${DEVICE}.pid" ]; then
+ rm -f /var/run/dhclient-${DEVICE}.pid
+ kill $dhcpid >/dev/null 2>&1
+ fi
fi
}
# we can't just delete the configured address because that address