proto_config_add_string pppd_options
proto_config_add_string 'connect:file'
proto_config_add_string 'disconnect:file'
- proto_config_add_string ipv6
+ [ -e /proc/sys/net/ipv6 ] && proto_config_add_string ipv6
proto_config_add_boolean authfail
proto_config_add_int mtu
proto_config_add_string pppname
local config="$1"; shift
local localip
- json_get_vars ipv6 ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns
+ json_get_vars ip6table demand keepalive keepalive_adaptive username password pppd_options pppname unnumbered persist maxfail holdoff peerdns
+
+ [ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6
+
if [ "$ipv6" = 0 ]; then
ipv6=""
elif [ -z "$ipv6" -o "$ipv6" = auto ]; then
${connect:+connect "$connect"} \
${disconnect:+disconnect "$disconnect"} \
ip-up-script /lib/netifd/ppp-up \
- ipv6-up-script /lib/netifd/ppp6-up \
+ ${ipv6:+ipv6-up-script /lib/netifd/ppp6-up} \
ip-down-script /lib/netifd/ppp-down \
- ipv6-down-script /lib/netifd/ppp-down \
+ ${ipv6:+ipv6-down-script /lib/netifd/ppp-down} \
${mtu:+mtu $mtu mru $mtu} \
"$@" $pppd_options
}