From 261132f9a65fbd97aab29097553748dd19a73a33 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 18 Jun 2010 00:24:52 +0200 Subject: [PATCH] network: pppoe: Kill pppd daemon in a better way. --- hooks/pppoe | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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} -- 2.39.2