aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults-new.sh9
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 ..
}