give basic commandline help
[openwrt.git] / package / ppp / files / ifup.pppoe
1 #!/bin/sh
2 [ $# = 0 ] && { echo " $0 <group>"; exit; }
3 . /etc/functions.sh
4 type=$1
5
6 [ "$(nvram get ${type}_proto)" = "pppoe" ] || {
7 echo "$0: ${type}_proto isn't pppoe"
8 exit
9 }
10
11 for module in slhc ppp_generic pppox pppoe; do
12 /sbin/insmod $module 2>&- >&-
13 done
14
15 while :; do
16 IFNAME=$(nvram get pppoe_ifname)
17 USERNAME=$(nvram get ppp_username)
18 PASSWORD=$(nvram get ppp_passwd)
19 REDIAL=$(nvram get ppp_redialperiod)
20 REDIAL=${REDIAL:+lcp-echo-interval $REDIAL}
21 IDLETIME=$(nvram get ppp_idletime)
22 IDLETIME=${IDLETIME:+lcp-echo-failure $IDLETIME}
23 MTU=$(nvram get ppp_mtu)
24 MTU=${MTU:+ mtu $MTU mru $MTU}
25
26 ifconfig $IFNAME up
27 /usr/sbin/pppd nodetach \
28 plugin rp-pppoe.so \
29 connect /bin/true \
30 usepeerdns \
31 defaultroute \
32 linkname $type \
33 user "$USERNAME" \
34 password "$PASSWORD" \
35 $MTU \
36 $IDLETIME \
37 $REDIAL \
38 $IFNAME
39 done &
This page took 0.047355 seconds and 5 git commands to generate.