autossh: update to 1.4e
[openadk.git] / package / pptp / files / ifup.pptp
blobf401a36b2fa6e88aacc6845c48d8b6d762bce73f
1 #!/bin/sh
2 [ $# = 0 ] && { echo " $0 <group>"; exit; }
3 . /etc/config/network
4 type=$1
6 eval "proto=\"\${${type}_proto}\""
7 [ "$proto" = "pptp" ] || {
8 echo "$0: ${type}_proto isn't pptp"
9 exit
12 mkdir -p /var/lock
14 for module in slhc ppp_generic ppp_async ip_gre; do
15 /sbin/insmod $module 2>&- >&-
16 done
18 KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5}
19 case "$ppp_demand" in
20 on|1|enabled)
21 DEMAND=${ppp_idletime:+demand idle $ppp_idletime}
22 [ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
24 *) DEMAND="persist";;
25 esac
26 MTU=${ppp_mtu:-1452}
28 [ "$pptp_proto" = "static" ] || pptp_proto="dhcp"
29 do_ifup $pptp_proto $type
31 /usr/sbin/pppd \
32 pty "/usr/sbin/pptp $pptp_server_ip --loglevel 0 --nolaunchpppd" \
33 file /etc/ppp/options.pptp \
34 connect /bin/true \
35 usepeerdns \
36 defaultroute \
37 replacedefaultroute \
38 linkname "$type" \
39 ipparam "$type" \
40 user "$ppp_username" \
41 password "$ppp_passwd" \
42 mtu $MTU mru $MTU \
43 $DEMAND \
44 $KEEPALIVE