base-files: board.json's switch reset means existence, not argument
authorJonas Gorski <jonas.gorski@gmail.com>
Sun, 11 Jun 2017 10:50:14 +0000 (12:50 +0200)
committerJonas Gorski <jonas.gorski@gmail.com>
Sun, 11 Jun 2017 10:50:14 +0000 (12:50 +0200)
Don't pass the value unconditionally to swconfig as a parameter but
instead only call reset if it is 1.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
package/base-files/files/lib/preinit/10_indicate_preinit

index a30bf34f6e114b51a7b7862e556c8ce04e1fc8fb..43bd04d44419fc88abd31268c2d1f15d2d61ee44 100644 (file)
@@ -43,7 +43,10 @@ preinit_config_switch() {
                        json_select ..
 
                        if [ "$device" = "$lan_if" ]; then
-                               swconfig dev $name set reset $reset
+                               if [ "$reset" -eq "1" ]; then
+                                       swconfig dev $name set reset
+                               fi
+
                                swconfig dev $name set enable_vlan $enable
                                swconfig dev $name vlan $role set ports "$ports"
                                swconfig dev $name set apply