2005-08-26 18:52:12 +03:00
|
|
|
#!/bin/sh
|
|
|
|
[ $# = 0 ] && { echo " $0 <group>"; exit; }
|
2006-04-05 05:09:22 +03:00
|
|
|
. /etc/config/network
|
2005-08-26 18:52:12 +03:00
|
|
|
type=$1
|
|
|
|
|
2006-04-05 05:09:22 +03:00
|
|
|
eval "proto=\"\${${type}_proto}\""
|
|
|
|
[ "$proto" = "pppoa" ] || {
|
2005-08-26 18:52:12 +03:00
|
|
|
echo "$0: ${type}_proto isn't pppoa"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2006-05-24 10:19:27 +03:00
|
|
|
mkdir -p /var/lock
|
|
|
|
|
2005-08-31 00:49:35 +03:00
|
|
|
for module in slhc ppp_generic pppoatm; do
|
2005-08-26 18:52:12 +03:00
|
|
|
/sbin/insmod $module 2>&- >&-
|
|
|
|
done
|
|
|
|
|
2006-04-05 05:09:22 +03:00
|
|
|
KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5}
|
|
|
|
case "$ppp_demand" in
|
2005-11-19 05:17:20 +02:00
|
|
|
on|1|enabled)
|
2006-04-05 05:09:22 +03:00
|
|
|
DEMAND=${ppp_idletime:+demand idle $ppp_idletime}
|
2006-03-18 19:27:20 +02:00
|
|
|
[ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
|
2005-11-19 05:17:20 +02:00
|
|
|
;;
|
|
|
|
*) DEMAND="persist";;
|
|
|
|
esac
|
2006-04-05 05:09:22 +03:00
|
|
|
MTU=${ppp_mtu:-1500}
|
2005-08-26 18:52:12 +03:00
|
|
|
|
2005-11-19 16:07:54 +02:00
|
|
|
/usr/sbin/pppd \
|
2006-04-05 05:09:22 +03:00
|
|
|
plugin pppoatm.so ${atm_vpi:-8}.${atm_vci:-35} \
|
2005-11-19 05:17:20 +02:00
|
|
|
usepeerdns \
|
|
|
|
defaultroute \
|
|
|
|
linkname $type \
|
|
|
|
ipparam $type \
|
2006-04-05 05:09:22 +03:00
|
|
|
user "$ppp_username" \
|
|
|
|
password "$ppp_passwd" \
|
2005-11-19 05:17:20 +02:00
|
|
|
mtu $MTU mru $MTU \
|
|
|
|
$DEMAND \
|
|
|
|
$KEEPALIVE
|