X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/c4f3575368c5aeef4134d82125df2814d688cc2a..f0845034ee1e6babeef0949390122a54dff3a156:/package/ppp/files/ppp.sh diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh index 0bb77b828..343223af1 100644 --- a/package/ppp/files/ppp.sh +++ b/package/ppp/files/ppp.sh @@ -1,7 +1,6 @@ scan_ppp() { config_get ifname "$1" ifname pppdev="${pppdev:-0}" - config_set "$1" device "$ifname" config_set "$1" ifname "ppp$pppdev" config_set "$1" unit "$pppdev" } @@ -13,15 +12,18 @@ 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 \ replacedefaultroute \ - ${username:+username "$username" password "$password"} \ + ${username:+user "$username" password "$password"} \ linkname "$cfg" \ ipparam "$cfg" }