Changeset 257cbc3 in freewrt for package/base-files


Ignore:
Timestamp:
Jul 11, 2006, 8:21:26 AM (19 years ago)
Author:
Waldemar Brodkorb <wbx@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
d629443
Parents:
3a3b320
Message:

use ifup/ifdown, hotplug and ppp scripts and options from known to work whiterussian

git-svn-id: svn://www.freewrt.org/trunk/freewrt@187 afb5a338-a214-0410-bd46-81f09a774fd1

Location:
package/base-files/default
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • package/base-files/default/sbin/hotplug

    r3a3b320 r257cbc3  
    11#!/bin/sh
    2 
    3 # bypass the normal hotplug path for firmware loading
    4 # would otherwise cause problems with drivers like bcm43xx
    5 [ "$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 0
    12 }
    13 
    142. /etc/functions.sh
    15 . /etc/config/network
    16 
    173PATH=/bin:/sbin:/usr/bin:/usr/sbin
    184LOGNAME=root
  • package/base-files/default/sbin/ifdown

    r3a3b320 r257cbc3  
    22[ $# = 0 ] && { echo "  $0 <group>"; exit; }
    33. /etc/functions.sh
    4 . /etc/config/network
    54
     5type=$1
    66debug "### ifdown $type ###"
    7 type=$1
    87
    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;;
     8if=$(nvram get ${type}_ifname)
     9proto=$(nvram get ${type}_proto)
     10if_valid $if && $DEBUG ifconfig $if down
     11[ -r /var/run/${if}.pid ] && kill $(cat /var/run/${if}.pid 2>&-) 2>&-
     12killall ifup.$proto >&- 2>&-
     13case "$proto" in
     14        pptp|pppoe) killall pppd >&- 2>&- ;;
     15        static) env -i ACTION="ifdown" INTERFACE="$if" PROTO=static /sbin/hotplug "iface" ;;
    1616esac
    1717
    18 hotplug_dev unregister "$if"
  • package/base-files/default/sbin/ifup

    r3a3b320 r257cbc3  
    1 #!/bin/sh
     1#!/bin/ash
    22[ $# = 0 ] && { echo "  $0 <group>"; exit; }
    33. /etc/functions.sh
    4 . /etc/config/network
     4type=$1
     5debug "### ifup $type ###"
    56
    6 ifdown $1
     7if_proto=$(nvram get ${type}_proto)
     8case "$if_proto" in
     9        none|"")exit;;
     10esac
     11if=$(nvram get ${type}_ifname)
     12[ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${type}_device)
    713
    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
     14if_valid $if || [ "$if_proto" = "pptp" ] || exit
     15mac=$(nvram get ${type}_hwaddr)
     16$DEBUG ifconfig $if down 2>&-
    2817
    2918if [ "${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
    3331        done
    3432else
    35         hotplug_dev register "$if"
     33        ${mac:+$DEBUG ifconfig $if down hw ether $mac}
    3634fi
     35
     36do_ifup $if_proto $type
Note: See TracChangeset for help on using the changeset viewer.