bsp/def/network.sh: configure switch based on HW name

Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
This commit is contained in:
Tim Niemeyer 2014-08-16 01:11:18 +02:00
parent fec705eb5f
commit ece49e2454
1 changed files with 7 additions and 3 deletions

View File

@ -5,13 +5,17 @@ if ! uci get nodewatcher.@network[0].client_interfaces; then
fi
if ! uci get network.$SWITCHDEV.ifname; then
SWITCHHW=$(swconfig list | awk '{ print $4 }')
uci set network.$SWITCHDEV=switch
uci set network.$SWITCHDEV.name=$SWITCHHW
uci set network.$SWITCHDEV.enable=1
uci set network.$SWITCHDEV.reset=1
uci set network.$SWITCHDEV.enable_vlan=1
uci set network.${SWITCHDEV}_1=switch_vlan
uci set network.${SWITCHDEV}_1.device=$SWITCHDEV
uci set network.${SWITCHDEV}_1.device=$SWITCHHW
uci set network.${SWITCHDEV}_1.vlan=1
uci set network.${SWITCHDEV}_1.ports="$CLIENT_PORTS"
@ -19,7 +23,7 @@ if ! uci get network.$SWITCHDEV.ifname; then
if [[ "$WANDEV" = "$SWITCHDEV" ]]; then
uci set network.${SWITCHDEV}_2=switch_vlan
uci set network.${SWITCHDEV}_2.device=$SWITCHDEV
uci set network.${SWITCHDEV}_2.device=$SWITCHHW
uci set network.${SWITCHDEV}_2.vlan=2
uci set network.${SWITCHDEV}_2.ports="$WAN_PORTS"
@ -35,7 +39,7 @@ if ! uci get network.$SWITCHDEV.ifname; then
fi
uci set network.${SWITCHDEV}_3=switch_vlan
uci set network.${SWITCHDEV}_3.device=$SWITCHDEV
uci set network.${SWITCHDEV}_3.device=$SWITCHHW
uci set network.${SWITCHDEV}_3.vlan=3
uci set network.${SWITCHDEV}_3.ports="$BATMAN_PORTS"