From 212feb9ccfc66e555bc917a76e5cabfb86ddedfe Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 25 Nov 2015 15:43:15 +0000 Subject: base-files: uci-defaults-new: don't store switch attr numbers as strings Signed-off-by: Jo-Philipp Wich SVN-Revision: 47643 --- package/base-files/files/lib/functions/uci-defaults-new.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'package/base-files') 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 .. } -- cgit v1.2.3