Revert "bcm53xx: remove useless echo in 02_network"

This reverts commit b1f6a5d9df.

In this particular case, the echo command was _not_ useless, but
converted the newlines back to spaces.

Add a comment into the code to make that obvious for the next one
looking at it like me.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2020-08-18 11:44:10 +02:00
parent 18ab496c32
commit 5388c72517

View File

@ -55,8 +55,9 @@ bcm53xx_setup_interfaces()
# vlan2ports=4 5u # vlan2ports=4 5u
# and early Netgear R8000 was using # and early Netgear R8000 was using
# vlan1ports=3 2 1 0 5 7 8* # vlan1ports=3 2 1 0 5 7 8*
vlan1ports="$(nvram get vlan1ports | tr " " "\n" | sort)" # (the enclosing echo is needed to convert newline back to space)
vlan2ports="$(nvram get vlan2ports | tr " " "\n" | sort)" vlan1ports="$(echo $(nvram get vlan1ports | tr " " "\n" | sort))"
vlan2ports="$(echo $(nvram get vlan2ports | tr " " "\n" | sort))"
if echo "$vlan1ports" | egrep -q "^1 2 3 4 5" && \ if echo "$vlan1ports" | egrep -q "^1 2 3 4 5" && \
echo "$vlan2ports" | egrep -q "^0 5"; then echo "$vlan2ports" | egrep -q "^0 5"; then
ucidef_add_switch "switch0" \ ucidef_add_switch "switch0" \