aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-11-25 15:43:15 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-11-25 15:43:15 +0000
commit212feb9ccfc66e555bc917a76e5cabfb86ddedfe (patch)
tree15621521b7ebfd679d4d4e5c764b3c44b538e6e6 /package
parent6638374f5d3f70a9b82545161bc523fdc6808a34 (diff)
downloadupstream-212feb9ccfc66e555bc917a76e5cabfb86ddedfe.tar.gz
upstream-212feb9ccfc66e555bc917a76e5cabfb86ddedfe.tar.bz2
upstream-212feb9ccfc66e555bc917a76e5cabfb86ddedfe.zip
base-files: uci-defaults-new: don't store switch attr numbers as strings
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47643
Diffstat (limited to 'package')
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults-new.sh9
1 files changed, 6 insertions, 3 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 6a8b6b9029..64241d5a5e 100755
--- a/package/base-files/files/lib/functions/uci-defaults-new.sh
+++ b/package/base-files/files/lib/functions/uci-defaults-new.sh
@@ -91,11 +91,14 @@ ucidef_add_switch_attr() {
local val=$3
json_select_object switch
-
json_select_object $name
- json_add_string $key $val
- json_select ..
+ case "$val" in
+ [0-9]) json_add_int "$key" "$val" ;;
+ *) json_add_string "$key" "$val" ;;
+ esac
+
+ json_select ..
json_select ..
}