4 [ -e /etc
/config
/network
] && .
/etc
/config
/network
7 [ "$(nvram get ${type}_proto)" = "pptp" ] ||
exit
9 [ -d "/var/lock" ] || mkdir
-p /var
/lock ||
exit 1
11 for module
in slhc ppp_generic ppp_async ip_gre
; do
12 /sbin
/insmod
$module 2>&- >&-
15 if=$
(nvram get pptp_ifname
)
16 ip
=$
(nvram get
${type}_ipaddr
)
17 netmask
=$
(nvram get
${type}_netmask
)
18 [ -z "$ip" -o -z "$if" ] || ifconfig
$if $ip ${netmask:+netmask $netmask} broadcast
+ up
21 IP
=$
(nvram get pptp_server_ip
)
22 USERNAME
=$
(nvram get ppp_username
)
23 PASSWORD
=$
(nvram get ppp_passwd
)
24 REDIAL
=$
(nvram get ppp_redialperiod
)
25 REDIAL
=${REDIAL:+lcp-echo-interval $REDIAL}
26 IDLETIME
=$
(nvram get ppp_idletime
)
27 IDLETIME
=${IDLETIME:+lcp-echo-failure $IDLETIME}
28 MTU
=$
(nvram get ppp_mtu
)
29 MTU
=${MTU:+ mtu $MTU mru $MTU}
31 /usr
/sbin
/pppd nodetach \
32 pty
"/usr/sbin/pptp $IP --loglevel 0 --nolaunchpppd" \
33 file /etc
/ppp
/options.pptp \
39 password
"$PASSWORD" \