diff options
| author | Bill Nottingham <notting@redhat.com> | 2005-02-14 21:06:13 +0000 |
|---|---|---|
| committer | Bill Nottingham <notting@redhat.com> | 2005-02-14 21:06:13 +0000 |
| commit | 88cfa3b7cd76374cea160abab0f44910b53c3d58 (patch) | |
| tree | 90a470a55f8996c5a4c701f2de6b0f1184eda961 /sysconfig | |
| parent | be8715eab05ae2ab874b41c2aba486e30d9e0cee (diff) | |
dhcp release cleanups (<jvdias@redhat.com>)
Diffstat (limited to 'sysconfig')
| -rwxr-xr-x | sysconfig/network-scripts/ifdown | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifdown b/sysconfig/network-scripts/ifdown index 703a1120..a28e9af2 100755 --- a/sysconfig/network-scripts/ifdown +++ b/sysconfig/network-scripts/ifdown @@ -82,14 +82,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 + recode=$? 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 } [ -n "`pidof -x dhcpcd`" ] && { |
