diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-10-24 23:59:08 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-10-24 23:59:08 +0000 |
commit | 315f8e954bf209cc2de0dfd423aaa0611afb869d (patch) | |
tree | 404cdd638c2d7667df57ed993e9aa3cccc9e55ca /package/ppp/files/ppp.sh | |
parent | 2f78952da8a9be5ca46dc3b705aa517072c9cec6 (diff) | |
download | master-31e0f0ae-315f8e954bf209cc2de0dfd423aaa0611afb869d.tar.gz master-31e0f0ae-315f8e954bf209cc2de0dfd423aaa0611afb869d.tar.bz2 master-31e0f0ae-315f8e954bf209cc2de0dfd423aaa0611afb869d.zip |
make network scripts more robust, prevent multiple instances of pppd and udhcpc for the same interface
SVN-Revision: 5290
Diffstat (limited to 'package/ppp/files/ppp.sh')
-rw-r--r-- | package/ppp/files/ppp.sh | 5 |
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 |