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/enable_vlan"
21 for vlan
in $
(seq 0 15); do
22 [ "$(nvram get vlan${vlan}hwname)" = "$if" ] && {
23 vports
="$(nvram get vlan${vlan}ports)"
24 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
25 $DEBUG vconfig add
"$INTERFACE" "$vlan"
32 case "${INTERFACE%%[0-9]*}" in
39 add|register
) do_register
;;