aboutsummaryrefslogtreecommitdiffstats
path: root/package/ppp/files
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-24 23:59:08 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-10-24 23:59:08 +0000
commit85926fd54776578737ae2463b3f64ef733c76dea (patch)
treeaf1827b34df373e91cb217e7fb8d6f78e87a575d /package/ppp/files
parent145ed685731972bce9a7dee08fd22af137ac5555 (diff)
downloadmaster-187ad058-85926fd54776578737ae2463b3f64ef733c76dea.tar.gz
master-187ad058-85926fd54776578737ae2463b3f64ef733c76dea.tar.bz2
master-187ad058-85926fd54776578737ae2463b3f64ef733c76dea.zip
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/files')
-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