Changeset 257cbc3 in freewrt
- Timestamp:
- Jul 11, 2006, 8:21:26 AM (19 years ago)
- Branches:
- freewrt_1_0, freewrt_2_0
- Children:
- d629443
- Parents:
- 3a3b320
- Location:
- package
- Files:
-
- 1 deleted
- 5 edited
-
base-files/default/etc/hotplug.d/net/10-net (deleted)
-
base-files/default/sbin/hotplug (modified) (1 diff)
-
base-files/default/sbin/ifdown (modified) (1 diff)
-
base-files/default/sbin/ifup (modified) (1 diff)
-
ppp/files/etc/ppp/options (modified) (1 diff)
-
ppp/files/ifup.pppoe (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
package/base-files/default/sbin/hotplug
r3a3b320 r257cbc3 1 1 #!/bin/sh 2 3 # bypass the normal hotplug path for firmware loading4 # would otherwise cause problems with drivers like bcm43xx5 [ "$1" = "firmware" -a "$ACTION" = "add" ] && {6 [ -f "/lib/firmware/$FIRMWARE" ] && {7 echo 1 > "/sys$DEVPATH/loading"8 cp "/lib/firmware/$FIRMWARE" "/sys$DEVPATH/data"9 echo 0 > "/sys$DEVPATH/loading"10 }11 exit 012 }13 14 2 . /etc/functions.sh 15 . /etc/config/network16 17 3 PATH=/bin:/sbin:/usr/bin:/usr/sbin 18 4 LOGNAME=root -
package/base-files/default/sbin/ifdown
r3a3b320 r257cbc3 2 2 [ $# = 0 ] && { echo " $0 <group>"; exit; } 3 3 . /etc/functions.sh 4 . /etc/config/network5 4 5 type=$1 6 6 debug "### ifdown $type ###" 7 type=$18 7 9 eval "if_proto=\"\${${type}_proto}\"" 10 eval "if=\"\${${type}_ifname}\"" 11 [ "${if%%[0-9]}" = "ppp" ] && eval "if=\"\${${type}_device}\"" 12 13 case "$if_proto" in 14 pppoa) hotplug_dev unregister atm0; exit 0 ;; 15 ""|none) exit 0;; 8 if=$(nvram get ${type}_ifname) 9 proto=$(nvram get ${type}_proto) 10 if_valid $if && $DEBUG ifconfig $if down 11 [ -r /var/run/${if}.pid ] && kill $(cat /var/run/${if}.pid 2>&-) 2>&- 12 killall ifup.$proto >&- 2>&- 13 case "$proto" in 14 pptp|pppoe) killall pppd >&- 2>&- ;; 15 static) env -i ACTION="ifdown" INTERFACE="$if" PROTO=static /sbin/hotplug "iface" ;; 16 16 esac 17 17 18 hotplug_dev unregister "$if" -
package/base-files/default/sbin/ifup
r3a3b320 r257cbc3 1 #!/bin/ sh1 #!/bin/ash 2 2 [ $# = 0 ] && { echo " $0 <group>"; exit; } 3 3 . /etc/functions.sh 4 . /etc/config/network 4 type=$1 5 debug "### ifup $type ###" 5 6 6 ifdown $1 7 if_proto=$(nvram get ${type}_proto) 8 case "$if_proto" in 9 none|"")exit;; 10 esac 11 if=$(nvram get ${type}_ifname) 12 [ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${type}_device) 7 13 8 debug "### ifup $type ###" 9 type=$1 10 11 eval "if_proto=\"\${${type}_proto}\"" 12 eval "if=\"\${${type}_ifname}\"" 13 [ "${if%%[0-9]}" = "ppp" ] && eval "if=\"\${${type}_device}\"" 14 15 case "$if_proto" in 16 pppoa) hotplug_dev register atm0; exit 0 ;; 17 pppoe) 18 # PPPoE over ATM 19 [ "$if" = "nas0" ] && { 20 ifconfig nas0 2>&- >&- || { 21 hotplug_dev register atm0 22 exit 0 23 } 24 } 25 ;; 26 none|"") exit 0;; 27 esac 14 if_valid $if || [ "$if_proto" = "pptp" ] || exit 15 mac=$(nvram get ${type}_hwaddr) 16 $DEBUG ifconfig $if down 2>&- 28 17 29 18 if [ "${if%%[0-9]}" = "br" ]; then 30 eval "ifnames=\"\${${type}_ifnames}\"" 31 for sif in $ifnames; do 32 hotplug_dev register "$sif" 19 stp=$(nvram get ${type}_stp) 20 $DEBUG brctl delbr $if 2>&- 21 $DEBUG brctl addbr $if 22 $DEBUG brctl setfd $if 0 23 $DEBUG brctl stp $if ${stp:-0} 24 25 for sif in $(nvram get ${type}_ifnames); do 26 if_valid $sif || continue 27 #${mac:+$DEBUG ifconfig $sif down hw ether $mac} 28 $DEBUG ifconfig $sif 0.0.0.0 up 29 $DEBUG brctl addif $if $sif 30 $DEBUG ifconfig $sif allmulti 33 31 done 34 32 else 35 hotplug_dev register "$if"33 ${mac:+$DEBUG ifconfig $if down hw ether $mac} 36 34 fi 35 36 do_ifup $if_proto $type -
package/ppp/files/etc/ppp/options
r3a3b320 r257cbc3 4 4 nocrtscts 5 5 lock 6 maxfail 0 -
package/ppp/files/ifup.pppoe
r3a3b320 r257cbc3 1 1 #!/bin/sh 2 2 [ $# = 0 ] && { echo " $0 <group>"; exit; } 3 . /etc/ config/network3 . /etc/functions.sh 4 4 type=$1 5 5 6 eval "proto=\"\${${type}_proto}\"" 7 [ "$proto" = "pppoe" ] || { 6 [ "$(nvram get ${type}_proto)" = "pppoe" ] || { 8 7 echo "$0: ${type}_proto isn't pppoe" 9 8 exit … … 16 15 done 17 16 18 eval "IFNAME=\"\${${type}_device}\"" 19 KEEPALIVE=${ppp_redialperiod:+lcp-echo-interval $ppp_redialperiod lcp-echo-failure 5} 20 case "$ppp_demand" in 21 on|1|enabled) 22 DEMAND=${ppp_idletime:+demand idle $ppp_idletime} 23 [ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND} 24 ;; 25 *) DEMAND="persist";; 26 esac 27 MTU=${ppp_mtu:-1492} 17 (while :; do 18 IFNAME=$(nvram get wan_device) 19 USERNAME=$(nvram get ppp_username) 20 PASSWORD=$(nvram get ppp_passwd) 21 KEEPALIVE=$(nvram get ppp_redialperiod) 22 KEEPALIVE=${KEEPALIVE:+lcp-echo-failure 5 lcp-echo-interval $KEEPALIVE} 23 DEMAND=$(nvram get ppp_demand) 24 case "$DEMAND" in 25 on|1|enabled) 26 DEMAND=$(nvram get ppp_idletime) 27 DEMAND=${DEMAND:+demand idle $DEMAND} 28 [ -f /etc/ppp/filter ] && DEMAND=${DEMAND:+precompiled-active-filter /etc/ppp/filter $DEMAND} 29 ;; 30 *) DEMAND="";; 31 esac 32 33 MTU=$(nvram get ppp_mtu) 34 MTU=${MTU:-1492} 28 35 29 ifconfig $IFNAME up 30 /usr/sbin/pppd \ 31 plugin rp-pppoe.so \ 32 connect /bin/true \ 33 usepeerdns \ 34 defaultroute \ 35 linkname $type \ 36 ipparam $type \ 37 user "$ppp_username" \ 38 password "$ppp_passwd" \ 39 mtu $MTU mru $MTU \ 40 $DEMAND \ 41 $KEEPALIVE \ 42 nic-$IFNAME 43 36 ifconfig $IFNAME up 37 /usr/sbin/pppd nodetach \ 38 plugin rp-pppoe.so \ 39 connect /bin/true \ 40 usepeerdns \ 41 defaultroute \ 42 replacedefaultroute \ 43 ipparam "$type" \ 44 linkname "$type" \ 45 user "$USERNAME" \ 46 password "$PASSWORD" \ 47 mtu $MTU \ 48 mru $MTU \ 49 $DEMAND \ 50 $KEEPALIVE \ 51 nic-$IFNAME 52 done 2>&1 >/dev/null ) &
Note:
See TracChangeset
for help on using the changeset viewer.
