4 for part
in $
(nvram get unused_ifnames
); do
5 [ "$part" = "$INTERFACE" ] && exit 0
7 [ -d /proc
/switch
] ||
{
9 insmod switch-robo || insmod switch-adm
11 if="$(echo "$INTERFACE" | sed s,eth,et,)"
12 ifconfig
"$INTERFACE" up
2>&- >&-
13 [ -d "/proc/switch/$INTERFACE" ] ||
return 0
14 echo "1" > "/proc/switch/$INTERFACE/reset"
15 echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
16 for vlan
in $
(seq 0 15); do
17 [ "$(nvram get vlan${vlan}hwname)" = "$if" ] && {
18 vports
="$(nvram get vlan${vlan}ports)"
19 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
20 $DEBUG vconfig add
"$INTERFACE" "$vlan"
27 case "${INTERFACE%%[0-9]*}" in
34 add|register
) do_register
;;