diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-03 21:12:51 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-03 21:12:51 +0000 |
commit | 556bc9580efeadf16f449be5a8207ccc31646983 (patch) | |
tree | dde79e2c81c59e7acc12f022d3776d320ad2d46a | |
parent | 8116a8d3a9d501512118bff18fcdcf41e472ab0a (diff) | |
download | master-187ad058-556bc9580efeadf16f449be5a8207ccc31646983.tar.gz master-187ad058-556bc9580efeadf16f449be5a8207ccc31646983.tar.bz2 master-187ad058-556bc9580efeadf16f449be5a8207ccc31646983.zip |
base-files: uci-defaults-new.sh: fix for handling multiple ifnames
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47728 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-x | package/base-files/files/lib/functions/uci-defaults-new.sh | 8 |
1 files changed, 4 insertions, 4 deletions
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 |