From b49c37365122a0f3f450be2aebff776fdc21afd4 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 14 Feb 2005 21:04:16 +0000 Subject: dhcp release cleanups () --- sysconfig/network-scripts/ifdown-eth | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sysconfig/network-scripts/ifdown-eth') 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 -- cgit v1.2.1