4 for part
in $
(nvram get unused_ifnames
); do
5 [ "$part" = "$INTERFACE" ] && exit 0
7 [ -f /proc
/net
/wl0
] && {
8 lsmod |
grep wlcompat
>&- || insmod wlcompat
10 iwconfig
"$INTERFACE" 2>&- |
grep -v 'no wireless' >&- && {
13 [ -d /proc
/switch
] ||
{
15 insmod switch-robo || insmod switch-adm
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"
33 case "${INTERFACE%%[0-9]*}" in
40 add|register
) do_register
;;