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-Url: http://git.lede-project.org./?a=commitdiff_plain;h=212feb9ccfc66e555bc917a76e5cabfb86ddedfe;p=openwrt%2Fstaging%2Fmans0n.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 .. }