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