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