2005-03-26 01:14:33 +00:00
|
|
|
#!/bin/sh
|
2005-07-15 16:56:23 +00:00
|
|
|
[ $# = 0 ] && { echo " $0 <group>"; exit; }
|
2006-04-05 02:09:22 +00:00
|
|
|
. /etc/config/network
|
2005-07-15 16:56:23 +00:00
|
|
|
type=$1
|
2005-03-26 01:14:33 +00:00
|
|
|
|
2006-04-05 02:09:22 +00:00
|
|
|
eval "proto=\"\${${type}_proto}\""
|
|
|
|
[ "$proto" = "pppoe" ] || {
|
2005-07-15 16:56:23 +00:00
|
|
|
echo "$0: ${type}_proto isn't pppoe"
|
|
|
|
exit
|
|
|
|
}
|
2005-03-26 01:14:33 +00:00
|
|
|
|
|
|
|
for module in slhc ppp_generic pppox pppoe; do
|
2005-07-15 16:56:23 +00:00
|
|
|
/sbin/insmod $module 2>&- >&-
|
2005-03-26 01:14:33 +00:00
|
|
|
done
|
|
|
|
|
2006-04-05 02:09:22 +00:00
|
|
|
eval "IFNAME=\"\${${type}_device}\""
|
|
|
|
KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5}
|
|
|
|
case "$ppp_demand" in
|
2005-11-19 03:17:20 +00:00
|
|
|
on|1|enabled)
|
2006-04-05 02:09:22 +00:00
|
|
|
DEMAND=${ppp_idletime:+demand idle $ppp_idletime}
|
2006-03-18 17:27:20 +00:00
|
|
|
[ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
|
2005-11-19 03:17:20 +00:00
|
|
|
;;
|
|
|
|
*) DEMAND="persist";;
|
|
|
|
esac
|
2006-04-05 02:09:22 +00:00
|
|
|
MTU=${ppp_mtu:-1492}
|
2005-11-19 03:17:20 +00:00
|
|
|
|
|
|
|
ifconfig $IFNAME up
|
2005-11-19 14:07:54 +00:00
|
|
|
/usr/sbin/pppd \
|
2005-11-19 03:17:20 +00:00
|
|
|
plugin rp-pppoe.so \
|
|
|
|
connect /bin/true \
|
|
|
|
usepeerdns \
|
|
|
|
defaultroute \
|
|
|
|
linkname $type \
|
|
|
|
ipparam $type \
|
2006-04-05 02:09:22 +00:00
|
|
|
user "$ppp_username" \
|
|
|
|
password "$ppp_passwd" \
|
2005-11-19 03:17:20 +00:00
|
|
|
mtu $MTU mru $MTU \
|
|
|
|
$DEMAND \
|
|
|
|
$KEEPALIVE \
|
|
|
|
nic-$IFNAME
|
2005-04-02 15:41:31 +00:00
|
|
|
|