From: Michael Tremer Date: Thu, 17 Jun 2010 22:24:52 +0000 (+0200) Subject: network: pppoe: Kill pppd daemon in a better way. X-Git-Tag: 001~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=261132f9a65fbd97aab29097553748dd19a73a33;p=network.git network: pppoe: Kill pppd daemon in a better way. --- diff --git a/hooks/pppoe b/hooks/pppoe index 5e18b84f..3d4af332 100755 --- a/hooks/pppoe +++ b/hooks/pppoe @@ -48,6 +48,13 @@ function _pppoe_real_device() { devicify ${device} } +function pppd_pid() { + local zone=${1} + shift + + cat /var/run/${zone}.pid 2>/dev/null +} + function _check() { assert isset USER assert isset SECRET @@ -189,13 +196,10 @@ function _down() { config_read ${ZONE_DIR}/${zone}/settings # Kill pppd - pid=$(cat /var/run/${zone}.pid 2>/dev/null) - if [ -n "${pid}" ]; then - kill ${pid} &>/dev/null - fi + kill $(pppd_pid ${zone}) &>/dev/null # Pull down device or remove virtual one - if [ -n "${DEVICE_VID}" ]; then + if [ -n "${DEVICE_VID}" ]; then device_remove_virtual ${DEVICE_MAC} else device_set_down ${DEVICE}