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 if=$
(nvram get pptp_ifname
)
14 ip
=$
(nvram get
${type}_ipaddr
)
15 netmask
=$
(nvram get
${type}_netmask
)
16 [ -z "$ip" -o -z "$if" ] || ifconfig
$if $ip ${netmask:+netmask $netmask} broadcast
+ up
19 IP
=$
(nvram get pptp_server_ip
)
20 USERNAME
=$
(nvram get ppp_username
)
21 PASSWORD
=$
(nvram get ppp_passwd
)
22 REDIAL
=$
(nvram get ppp_redialperiod
)
23 REDIAL
=${REDIAL:+lcp-echo-interval $REDIAL}
24 IDLETIME
=$
(nvram get ppp_idletime
)
25 IDLETIME
=${IDLETIME:+lcp-echo-failure $IDLETIME}
26 MTU
=$
(nvram get ppp_mtu
)
27 MTU
=${MTU:+ mtu $MTU mru $MTU}
29 /usr
/sbin
/pppd nodetach \
30 pty
"/usr/sbin/pptp $IP --loglevel 0 --nolaunchpppd" \
31 file /etc
/ppp
/options.pptp \
37 password
"$PASSWORD" \