source: trunk/openwrt/package/ppp/files/ifup.pppoe @ 3588

Last change on this file since 3588 was 3588, checked in by nbd, 10 years ago

large init script cleanup and merge of whiterussian changes, new dnsmasq config handling

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 897 bytes
Line 
1#!/bin/sh
2[ $# = 0 ] && { echo "  $0 <group>"; exit; }
3. /etc/config/network
4type=$1
5
6eval "proto=\"\${${type}_proto}\""
7[ "$proto" = "pppoe" ] || {
8        echo "$0: ${type}_proto isn't pppoe"
9        exit
10}
11
12for module in slhc ppp_generic pppox pppoe; do
13        /sbin/insmod $module 2>&- >&-
14done
15
16eval "IFNAME=\"\${${type}_device}\""
17KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5}
18case "$ppp_demand" in
19        on|1|enabled)
20                DEMAND=${ppp_idletime:+demand idle $ppp_idletime}
21                [ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND}
22        ;;
23        *) DEMAND="persist";;
24esac
25MTU=${ppp_mtu:-1492}
26
27ifconfig $IFNAME up
28/usr/sbin/pppd \
29        plugin rp-pppoe.so \
30        connect /bin/true \
31        usepeerdns \
32        defaultroute \
33        linkname $type \
34        ipparam $type \
35        user "$ppp_username" \
36        password "$ppp_passwd" \
37        mtu $MTU mru $MTU \
38        $DEMAND \
39        $KEEPALIVE \
40        nic-$IFNAME
41
Note: See TracBrowser for help on using the repository browser.