base-files: uci-defaults-new.sh: fix for handling multiple ifnames
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 3 Dec 2015 21:12:51 +0000 (21:12 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 3 Dec 2015 21:12:51 +0000 (21:12 +0000)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 47728

package/base-files/files/lib/functions/uci-defaults-new.sh

index f025cb696efe63e3a9945fade60b4e74a985ca48..14c7f9294da670205e285bd55f9f246d13e90b2b 100755 (executable)
@@ -166,11 +166,11 @@ _ucidef_finish_switch_roles() {
                json_select_object network
                        json_select_object "$role"
                                # attach previous interfaces (for multi-switch devices)
-                               local prev_device; json_get_var prev_device ifname
-                               if ! list_contains prev_device "$device"; then
-                                       device="${prev_device:+$prev_device }$device"
+                               local devices; json_get_var devices ifname
+                               if ! list_contains devices "$device"; then
+                                       devices="${devices:+$devices }$device"
                                fi
-                               json_add_string ifname "$device"
+                               json_add_string ifname "$devices"
                        json_select ..
                json_select ..
        done