From: Jo-Philipp Wich Date: Wed, 25 Nov 2015 15:43:15 +0000 (+0000) Subject: base-files: uci-defaults-new: don't store switch attr numbers as strings X-Git-Tag: reboot~1413 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=212feb9ccfc66e555bc917a76e5cabfb86ddedfe;p=oweals%2Fopenwrt.git base-files: uci-defaults-new: don't store switch attr numbers as strings Signed-off-by: Jo-Philipp Wich SVN-Revision: 47643 --- 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 .. }