allow the user to override the lcp echo interval in ppp network configurations
authorFelix Fietkau <nbd@openwrt.org>
Tue, 12 Sep 2006 00:31:37 +0000 (00:31 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 12 Sep 2006 00:31:37 +0000 (00:31 +0000)
SVN-Revision: 4780

openwrt/package/ppp/files/ppp.sh

index a162b9730215ddd63a6b203493f4432e6775465d..e6008f40c82e40f2ba143c6f99679113fb2520e2 100644 (file)
@@ -13,10 +13,13 @@ start_pppd() {
        config_get username "$cfg" username
        config_get password "$cfg" password
        config_get keepalive "$cfg" keepalive
+       interval="${keepalive%%*,}"
+       [ "$interval" != "$keepalive" ] || interval=5
+       
        config_get demand "$cfg" demand
        [ -n "$demand" ] && echo "nameserver 1.1.1.1" > /tmp/resolv.conf
        /usr/sbin/pppd "$@" \
-               ${keepalive:+lcp-echo-interval 5 lcp-echo-failure $keepalive} \
+               ${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive##,*}} \
                ${demand:+precompiled-active-filter /etc/ppp/filter demand idle }${demand:-persist} \
                usepeerdns \
                defaultroute \