From: Jo-Philipp Wich Date: Thu, 3 Dec 2015 21:12:51 +0000 (+0000) Subject: base-files: uci-defaults-new.sh: fix for handling multiple ifnames X-Git-Tag: reboot~1333 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=734ae1bd178a778a909335cf8ac633d4b7c39f51;p=oweals%2Fopenwrt.git base-files: uci-defaults-new.sh: fix for handling multiple ifnames Signed-off-by: Jo-Philipp Wich SVN-Revision: 47728 --- diff --git a/package/base-files/files/lib/functions/uci-defaults-new.sh b/package/base-files/files/lib/functions/uci-defaults-new.sh index f025cb696e..14c7f9294d 100755 --- a/package/base-files/files/lib/functions/uci-defaults-new.sh +++ b/package/base-files/files/lib/functions/uci-defaults-new.sh @@ -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