summaryrefslogtreecommitdiff
path: root/package/ppp
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-24 23:59:08 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-24 23:59:08 +0000
commit6628b238eba06815a19c51a2f7a700a5c83032ae (patch)
treeaf1827b34df373e91cb217e7fb8d6f78e87a575d /package/ppp
parent58c8f8ef5a038b47e39f7b8c9662493f4cde1317 (diff)
make network scripts more robust, prevent multiple instances of pppd and udhcpc for the same interface
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5290 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/ppp')
-rw-r--r--package/ppp/files/ppp.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh
index 343223af1b..133400509c 100644
--- a/package/ppp/files/ppp.sh
+++ b/package/ppp/files/ppp.sh
@@ -7,6 +7,11 @@ scan_ppp() {
start_pppd() {
local cfg="$1"; shift
+
+ # make sure only one pppd process is started
+ local pid="$(cat /var/run/ppp-${cfg}.pid 2>/dev/null)"
+ [ -d "/proc/$pid" ] && grep pppd "/proc/$pid/cmdline" 2>/dev/null >/dev/null && return 0
+
config_get device "$cfg" device
config_get unit "$cfg" unit
config_get username "$cfg" username