2005-03-26 03:14:33 +02:00
|
|
|
#!/bin/sh
|
2005-07-15 19:56:23 +03:00
|
|
|
[ $# = 0 ] && { echo " $0 <group>"; exit; }
|
2005-03-26 03:14:33 +02:00
|
|
|
. /etc/functions.sh
|
2005-07-15 19:56:23 +03:00
|
|
|
type=$1
|
2005-03-26 03:14:33 +02:00
|
|
|
|
2005-07-15 19:56:23 +03:00
|
|
|
[ "$(nvram get ${type}_proto)" = "pppoe" ] || {
|
|
|
|
echo "$0: ${type}_proto isn't pppoe"
|
|
|
|
exit
|
|
|
|
}
|
2005-03-26 03:14:33 +02:00
|
|
|
|
|
|
|
for module in slhc ppp_generic pppox pppoe; do
|
2005-07-15 19:56:23 +03:00
|
|
|
/sbin/insmod $module 2>&- >&-
|
2005-03-26 03:14:33 +02:00
|
|
|
done
|
|
|
|
|
2005-07-15 19:56:23 +03:00
|
|
|
while :; do
|
|
|
|
IFNAME=$(nvram get pppoe_ifname)
|
|
|
|
USERNAME=$(nvram get ppp_username)
|
|
|
|
PASSWORD=$(nvram get ppp_passwd)
|
|
|
|
REDIAL=$(nvram get ppp_redialperiod)
|
|
|
|
REDIAL=${REDIAL:+lcp-echo-interval $REDIAL}
|
|
|
|
IDLETIME=$(nvram get ppp_idletime)
|
|
|
|
IDLETIME=${IDLETIME:+lcp-echo-failure $IDLETIME}
|
|
|
|
MTU=$(nvram get ppp_mtu)
|
|
|
|
MTU=${MTU:+ mtu $MTU mru $MTU}
|
2005-04-02 18:41:31 +03:00
|
|
|
|
2005-07-15 19:56:23 +03:00
|
|
|
ifconfig $IFNAME up
|
|
|
|
/usr/sbin/pppd nodetach \
|
|
|
|
plugin rp-pppoe.so \
|
|
|
|
connect /bin/true \
|
|
|
|
usepeerdns \
|
|
|
|
defaultroute \
|
|
|
|
linkname $type \
|
|
|
|
user "$USERNAME" \
|
|
|
|
password "$PASSWORD" \
|
|
|
|
$MTU \
|
|
|
|
$IDLETIME \
|
|
|
|
$REDIAL \
|
|
|
|
$IFNAME
|
|
|
|
done &
|