2 route
-n |
awk '$1 == "0.0.0.0" { print $2; exit }'
6 config_set
"$1" device
"pptp-$1"
9 stop_interface_pptp
() {
10 stop_interface_ppp
"$1"
13 coldplug_interface_pptp
() {
14 setup_interface_pptp
"pptp-$1" "$1"
17 setup_interface_pptp
() {
22 config_get device
"$config" device
25 config_get ipproto
"$config" ipproto
28 config_get server
"$config" server
31 config_get_bool buffering
"$config" buffering
1
32 [ "$buffering" == 0 ] && buffering
="--nobuffer" || buffering
=
34 for module
in slhc ppp_generic ppp_async ip_gre
; do
35 /sbin
/insmod
$module 2>&- >&-
39 setup_interface
"$device" "$config" "${ipproto:-dhcp}"
42 [ "$gw" != 0.0.0.0 ] && route delete
"$server" 2>/dev
/null
>/dev
/null
43 route add
"$server" gw
"$gw"
47 config_get netmask
"$config" netmask
48 [ -z "$netmask" -o -z "$device" ] || ifconfig
$device netmask
$netmask
50 config_get mtu
"$config" mtu
52 start_pppd
"$config" \
53 pty
"/usr/sbin/pptp $server --loglevel 0 --nolaunchpppd $buffering" \
54 file /etc
/ppp
/options.pptp \