summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-12-03 21:12:51 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-12-03 21:12:51 +0000
commit734ae1bd178a778a909335cf8ac633d4b7c39f51 (patch)
treea9e273f68f22ce9f85efb5d53404c3cf52cca6da /package/base-files
parent82c491708bcf16510d20a4dccc144a319386d6a1 (diff)
downloadmtk-20170518-734ae1bd178a778a909335cf8ac633d4b7c39f51.zip
mtk-20170518-734ae1bd178a778a909335cf8ac633d4b7c39f51.tar.gz
mtk-20170518-734ae1bd178a778a909335cf8ac633d4b7c39f51.tar.bz2
base-files: uci-defaults-new.sh: fix for handling multiple ifnames
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47728
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults-new.sh8
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 f025cb6..14c7f92 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