source: branches/whiterussian/openwrt/package/base-files/default/sbin/ifup @ 3428

Last change on this file since 3428 was 3428, checked in by mbm, 11 years ago

don't force the mac address of bridged interfaces

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 838 bytes
Line 
1#!/bin/ash
2[ $# = 0 ] && { echo "  $0 <group>"; exit; }
3. /etc/functions.sh
4type=$1
5debug "### ifup $type ###"
6
7if_proto=$(nvram get ${type}_proto)
8if=$(nvram get ${type}_ifname)
9[ "${if%%[0-9]}" = "ppp" ] && if=$(nvram get ${type}_device)
10
11if_valid $if || [ "$if_proto" = "pptp" ] || exit
12mac=$(nvram get ${type}_hwaddr)
13$DEBUG ifconfig $if down 2>&-
14
15if [ "${if%%[0-9]}" = "br" ]; then
16        stp=$(nvram get ${type}_stp)
17        $DEBUG brctl delbr $if 2>&-
18        $DEBUG brctl addbr $if
19        $DEBUG brctl setfd $if 0
20        $DEBUG brctl stp $if ${stp:-0}
21
22        for sif in $(nvram get ${type}_ifnames); do
23                if_valid $sif || continue
24                #${mac:+$DEBUG ifconfig $sif down hw ether $mac}
25                $DEBUG ifconfig $sif 0.0.0.0 up
26                $DEBUG brctl addif $if $sif
27                $DEBUG ifconfig $sif allmulti
28        done
29else
30        ${mac:+$DEBUG ifconfig $if down hw ether $mac}
31fi
32
33do_ifup $if_proto $type
Note: See TracBrowser for help on using the repository browser.