6821bf728bb1fc2c05a1b7c0e997363ce60fdd90
[openwrt.git] / target / linux / package / base-files / files / brcm-2.4 / etc / hotplug.d / net / 09-net
1 #!/bin/sh
2 setup_eth()
3 {
4 for part in $(nvram get unused_ifnames); do
5 [ "$part" = "$INTERFACE" ] && exit 0
6 done
7 [ -f /proc/net/wl0 ] && {
8 lsmod | grep wlcompat >&- || insmod wlcompat
9 }
10 iwconfig "$INTERFACE" 2>&- | grep -v 'no wireless' >&- && {
11 /sbin/wifi
12 }
13 [ -d /proc/switch ] || {
14 insmod switch-core
15 insmod switch-robo || insmod switch-adm
16 }
17 if="$(echo "$INTERFACE" | sed s,eth,et,)"
18 ifconfig "$INTERFACE" up 2>&- >&-
19 [ -d "/proc/switch/$INTERFACE" ] || return 0
20 echo "1" > "/proc/switch/$INTERFACE/reset"
21 echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
22 for vlan in $(seq 0 15); do
23 [ "$(nvram get vlan${vlan}hwname)" = "$if" ] && {
24 vports="$(nvram get vlan${vlan}ports)"
25 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
26 $DEBUG vconfig add "$INTERFACE" "$vlan"
27 }
28 done
29 }
30
31 do_register()
32 {
33 case "${INTERFACE%%[0-9]*}" in
34 eth) setup_eth;;
35 esac
36 }
37
38
39 case "$ACTION" in
40 add|register) do_register;;
41 esac
This page took 0.046967 seconds and 3 git commands to generate.