diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-05-05 23:24:11 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-05-05 23:24:11 +0000 |
commit | d9494637a8729f3ec6c4f940c190d8864acd4ebb (patch) | |
tree | 4bb3c9934306627fd565eb8f47392887e93d4cd2 /package/ppp | |
parent | 6c8910d06f31e7b2112055fd97833aae96d6b64e (diff) |
[package] base-files, ppp: remove protocol specific cleanup code from /sbin/ifdown and move it to protocol stop callbacks
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21383 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/ppp')
-rw-r--r-- | package/ppp/files/ppp.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh index bc18d1ec9a..b3c9e53655 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() { |