summaryrefslogtreecommitdiff
path: root/package/ppp
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-05-05 23:24:11 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-05-05 23:24:11 +0000
commit66ab73d01f264bd8d3043809d47ab071ad3670a0 (patch)
tree81c60ad8a22f3ba5116db855dc1a563c55f1b244 /package/ppp
parent731983969a1340b613db96111eb7371d57728dd6 (diff)
downloadmtk-20170518-66ab73d01f264bd8d3043809d47ab071ad3670a0.zip
mtk-20170518-66ab73d01f264bd8d3043809d47ab071ad3670a0.tar.gz
mtk-20170518-66ab73d01f264bd8d3043809d47ab071ad3670a0.tar.bz2
base-files, ppp: remove protocol specific cleanup code from /sbin/ifdown and move it to protocol stop callbacks
SVN-Revision: 21383
Diffstat (limited to 'package/ppp')
-rw-r--r--package/ppp/files/ppp.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh
index bc18d1e..b3c9e53 100644
--- a/package/ppp/files/ppp.sh
+++ b/package/ppp/files/ppp.sh
@@ -10,8 +10,13 @@ stop_interface_ppp() {
local link="${proto:-ppp}-$ifname"
[ -f "/var/run/ppp-${link}.pid" ] && {
local pid="$(head -n1 /var/run/ppp-${link}.pid 2>/dev/null)"
- grep -qs pppd "/proc/$pid/cmdline" && kill -TERM $pid
+ grep -qs pppd "/proc/$pid/cmdline" && kill -TERM $pid && \
+ while grep -qs pppd "/proc/$pid/cmdline"; do sleep 1; done
+ rm -f "/var/run/ppp-${link}.pid"
}
+
+ local lock="/var/lock/ppp-$link"
+ [ -f "$lock" ] && lock -u "$lock"
}
start_pppd() {