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 | 09c61f319e376a3332cc5ae102cafc12ae41f9af (patch) | |
tree | 9db085b6d52d5884d921428a7605f810eaaf787d | |
parent | 43d6387a897b300d07c7c6a762bc21a6500233a8 (diff) | |
download | master-187ad058-09c61f319e376a3332cc5ae102cafc12ae41f9af.tar.gz master-187ad058-09c61f319e376a3332cc5ae102cafc12ae41f9af.tar.bz2 master-187ad058-09c61f319e376a3332cc5ae102cafc12ae41f9af.zip |
base-files: uci-defaults-new: don't store switch attr numbers as strings
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47643 3c298f89-4303-0410-b956-a3cf2f4a3e73
-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 .. } |