|
Lines 507-515
stop_dhcp_client()
Link Here
|
| 507 |
;; |
507 |
;; |
| 508 |
esac |
508 |
esac |
| 509 |
if [ -s $PIDFILE ]; then |
509 |
if [ -s $PIDFILE ]; then |
| 510 |
kill -SIGHUP `cat $PIDFILE` |
510 |
local pid=`cat $PIDFILE` |
| 511 |
# There probably should be a delay/wait loop here, dhcpcd doesn't die fast. |
511 |
local i=0 |
| 512 |
sleep ${DHCP_GRACE_TIME:-0} |
512 |
kill -SIGHUP $pid |
|
|
513 |
while [ "$i" -lt "${DHCP_GRACE_TIME:-0}" ] && kill -0 $pid 2>/dev/null; do |
| 514 |
sleep 1 |
| 515 |
i=$(($i + 1)) |
| 516 |
done |
| 513 |
# dhcpcd will bring down the interface when stopping. To keep etcnet logics |
517 |
# dhcpcd will bring down the interface when stopping. To keep etcnet logics |
| 514 |
# to work (running shutdown scripts for example) we should bring it up again |
518 |
# to work (running shutdown scripts for example) we should bring it up again |
| 515 |
$IP link set dev $NAME up |
519 |
$IP link set dev $NAME up |