base-files: uci-defaults-new.sh: fix for handling multiple ifnames

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47728
This commit is contained in:
Jo-Philipp Wich 2015-12-03 21:12:51 +00:00
parent 82c491708b
commit 734ae1bd17

View File

@ -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