[package] ppp: introduce "authfail" option which specifies whether pppd should attemp...
[openwrt.git] / package / ppp / files / ppp.sh
index 5016be8..7e9b8dd 100755 (executable)
@@ -19,6 +19,7 @@ ppp_generic_init_config() {
        proto_config_add_boolean "defaultroute"
        proto_config_add_boolean "peerdns"
        proto_config_add_boolean "ipv6"
+       proto_config_add_boolean "authfail"
        proto_config_add_int "mtu"
 }
 
@@ -70,7 +71,10 @@ ppp_generic_teardown() {
        case "$ERROR" in
                11|19)
                        proto_notify_error "$interface" AUTH_FAILED
-                       proto_block_restart "$interface"
+                       json_get_var authfail authfail
+                       if [ "${authfail:-0}" -gt 0 ]; then
+                               proto_block_restart "$interface"
+                       fi
                ;;
                2)
                        proto_notify_error "$interface" INVALID_OPTIONS
@@ -169,7 +173,6 @@ proto_pppoa_teardown() {
 proto_pptp_init_config() {
        ppp_generic_init_config
        proto_config_add_string "server"
-       proto_config_add_boolean "buffering"
        available=1
        no_device=1
 }
@@ -192,10 +195,6 @@ proto_pptp_setup() {
                exit 1
        }
 
-       local buffering
-       json_get_var buffering buffering
-       [ "${buffering:-1}" == 0 ] && buffering="--nobuffer" || buffering=
-
        local load
        for module in slhc ppp_generic ppp_async ppp_mppe ip_gre gre pptp; do
                grep -q "$module" /proc/modules && continue