90a92bd2b0c9da3534584e88c3d5a580907ca47d
[openwrt.git] / package / base-files / brcm-2.6 / etc / hotplug.d / net / 09-net
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3
4 setup_eth()
5 {
6 [ -d /proc/switch ] || {
7 insmod switch-core
8 insmod switch-robo || insmod switch-adm
9 }
10 if="$(echo "$INTERFACE" | sed s,eth,et,)"
11 ifconfig "$INTERFACE" up 2>&- >&-
12 [ -d "/proc/switch/$INTERFACE" ] || return 0
13 echo "1" > "/proc/switch/$INTERFACE/reset"
14 echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
15 for vlan in $(seq 0 15); do
16 eval "hwname=\"\${vlan${vlan}hwname}\""
17 [ "$hwname" = "$if" ] && {
18 eval "vports=\"\${vlan${vlan}ports}\""
19 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
20 $DEBUG vconfig add "$INTERFACE" "$vlan"
21 }
22 done
23 }
24
25 do_register()
26 {
27 case "${INTERFACE%%[0-9]*}" in
28 eth) setup_eth;;
29 esac
30 }
31
32
33 case "$ACTION" in
34 add|register) do_register;;
35 esac
This page took 0.038251 seconds and 3 git commands to generate.