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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec50511a03bd160a7c834de1a9e55d57739cdd95;p=ipfire-3.x.git network: pppoe: Kill pppd daemon in a better way. --- diff --git a/pkgs/core/network/src/hooks/pppoe b/pkgs/core/network/src/hooks/pppoe index 5e18b84f1..3d4af332f 100755 --- a/pkgs/core/network/src/hooks/pppoe +++ b/pkgs/core/network/src/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}