Developing lightweight computation at the DSG edge

lamobo-r1_vlan_12_all_ports.sh 621 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
# Stage = [birth|firstboot|anyboot|preconf|postconf]
STAGE="$1"

[ "$STAGE" == "birth" ] && {
        echo "Configuring mesh in all Ethernet ports"
        uci set qmp.interfaces.mesh_devices="eth0.12"
        uci set qmp.interfaces.no_vlan_devices="eth0.12"
        uci commit qmp
}


[ "$STAGE" == "firstboot" ] && {

	echo "Configuring VLAN 12 on all ports, tagged"

	uci add network switch_vlan
	uci set network.@switch_vlan[-1]=switch_vlan
	uci set network.@switch_vlan[-1].device=switch0
	uci set network.@switch_vlan[-1].vlan=12
	uci set network.@switch_vlan[-1].ports="0t 1t 2t 3t 4t 8t"

	uci commit
}