revert last change and add a different fix
[openwrt.git] / package / ppp / files / ifup.pppoe
1 #!/bin/sh
2 [ $# = 0 ] && { echo " $0 <group>"; exit; }
3 . /etc/config/network
4 type=$1
5
6 eval "proto=\"\${${type}_proto}\""
7 [ "$proto" = "pppoe" ] || {
8 echo "$0: ${type}_proto isn't pppoe"
9 exit
10 }
11
12 mkdir -p /var/lock
13
14 for module in slhc ppp_generic pppox pppoe; do
15 /sbin/insmod $module 2>&- >&-
16 done
17
18 eval "IFNAME=\"\${${type}_device}\""
19 KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5}
20 case "$ppp_demand" in
21 on|1|enabled)
22 DEMAND=${ppp_idletime:+demand idle $ppp_idletime}
23 [ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
24 ;;
25 *) DEMAND="persist";;
26 esac
27 MTU=${ppp_mtu:-1492}
28
29 ifconfig $IFNAME up
30 /usr/sbin/pppd \
31 plugin rp-pppoe.so \
32 connect /bin/true \
33 usepeerdns \
34 defaultroute \
35 linkname $type \
36 ipparam $type \
37 user "$ppp_username" \
38 password "$ppp_passwd" \
39 mtu $MTU mru $MTU \
40 $DEMAND \
41 $KEEPALIVE \
42 nic-$IFNAME
43
This page took 0.050263 seconds and 5 git commands to generate.