5 [ "$(nvram get ${type}_proto)" = "pptp" ] ||
exit
7 [ -d "/var/lock" ] || mkdir
-p /var
/lock ||
exit 1
9 for module
in slhc ppp_generic ppp_async ip_gre
; do
10 /sbin
/insmod
$module 2>&- >&-
13 PPTP_PROTO
="$(nvram get pptp_proto)"
14 [ "$PPTP_PROTO" = "static" ] || PPTP_PROTO
=""
15 PPTP_PROTO
="${PPTP_PROTO:-dhcp}"
16 IP
=$
(nvram get pptp_server_ip
)
17 USERNAME
=$
(nvram get ppp_username
)
18 PASSWORD
=$
(nvram get ppp_passwd
)
19 KEEPALIVE
=$
(nvram get ppp_redialperiod
)
20 KEEPALIVE
=${KEEPALIVE:+lcp-echo-interval 10 lcp-echo-failure $KEEPALIVE}
21 DEMAND
=$
(nvram get ppp_demand
)
24 DEMAND
=$
(nvram get ppp_idletime
)
25 DEMAND
=${IDLETIME:+demand idle $IDLETIME}
26 [ -f /etc
/ppp
/filter
] && DEMAND
=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
30 MTU
=$
(nvram get ppp_mtu
)
33 do_ifup
$PPTP_PROTO $type
35 # hack for some buggy ISPs
36 NETMASK
=$
(nvram get
${type}_netmask
)
37 IFNAME
=$
(nvram get
${type}_device
)
38 [ -z "$NETMASK" -o -z "$IFNAME" ] || ifconfig
$IFNAME netmask
$NETMASK
41 pty
"/usr/sbin/pptp $IP --loglevel 0 --nolaunchpppd" \
42 file /etc
/ppp
/options.pptp \
50 password
"$PASSWORD" \