add lcp ping to ppp ifup script so that it timeouts properly (fixes #42)
[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 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 KEEPALIVE=$(nvram get ppp_redialperiod)
23 KEEPALIVE=${KEEPALIVE:+lcp-echo-interval 10 lcp-echo-failure $KEEPALIVE}
24 DEMAND=$(nvram get ppp_demand)
25 case "$DEMAND" in
26 on|1|enabled)
27 DEMAND=$(nvram get ppp_idletime)
28 DEMAND=${IDLETIME:+demand idle $IDLETIME}
29 ;;
30 *) DEMAND="";;
31 esac
32 MTU=$(nvram get ppp_mtu)
33 MTU=${MTU:-1500}
34
35 /usr/sbin/pppd nodetach \
36 plugin pppoatm.so ${VPI:-8}.${VCI:-35} \
37 usepeerdns \
38 defaultroute \
39 linkname $type \
40 ipparam $type \
41 user "$USERNAME" \
42 password "$PASSWORD" \
43 mtu $MTU mru $MTU \
44 $DEMAND \
45 $KEEPALIVE
46
47 # Read settings again (might have changed)
48 [ -e /etc/config/network ] && . /etc/config/network
49 done &
This page took 0.057171 seconds and 5 git commands to generate.