diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-25 15:43:15 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-11-25 15:43:15 +0000 |
commit | 212feb9ccfc66e555bc917a76e5cabfb86ddedfe (patch) | |
tree | 15621521b7ebfd679d4d4e5c764b3c44b538e6e6 /package/base-files/files/lib | |
parent | 6638374f5d3f70a9b82545161bc523fdc6808a34 (diff) | |
download | upstream-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/base-files/files/lib')
-rwxr-xr-x | package/base-files/files/lib/functions/uci-defaults-new.sh | 9 |
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 .. } |