4 [ -d /proc
/switch
] ||
{
6 insmod switch-robo || insmod switch-adm
8 if="$(echo "$INTERFACE" | sed s,eth,et,)"
9 ifconfig
"$INTERFACE" up
2>&- >&-
10 [ -d "/proc/switch/$INTERFACE" ] ||
return 0
11 echo "1" > "/proc/switch/$INTERFACE/reset"
12 echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
13 for vlan
in $
(seq 0 15); do
14 eval "hwname=\"\${vlan${vlan}hwname}\""
15 [ "$hwname" = "$if" ] && {
16 eval "vports=\"\${vlan${vlan}ports}\""
17 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
18 $DEBUG vconfig add
"$INTERFACE" "$vlan"
25 case "${INTERFACE%%[0-9]*}" in
32 add|register
) do_register
;;