summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/root/usr/bin
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-04-25 20:55:02 +0200
committerJo-Philipp Wich <jo@mein.io>2022-04-25 20:59:39 +0200
commitf16037cec5e3f65cffe2f5788c264f1912435b0e (patch)
treeafb961cf1518f10e6e57cdc8f0fa61fa4d8a50ff /applications/luci-app-statistics/root/usr/bin
parent1f36d5625731a0acb265c5a8e137e2c844d4492c (diff)
luci-app-statistics: stat-genconfig: don't emit bools for absent uci options
Do not emit native collectd.conf boolean false options if the corresponding uci option is unset in order to honour collectd's implicit defaults. This fixes certain options, such as the memory plugins `ValuesAbsolute`, being without effect if declared as default-enabled in the related plugin uci forms. Fixes: #5777 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-statistics/root/usr/bin')
-rwxr-xr-xapplications/luci-app-statistics/root/usr/bin/stat-genconfig10
1 files changed, 5 insertions, 5 deletions
diff --git a/applications/luci-app-statistics/root/usr/bin/stat-genconfig b/applications/luci-app-statistics/root/usr/bin/stat-genconfig
index fa59edc3a9..15e11e193e 100755
--- a/applications/luci-app-statistics/root/usr/bin/stat-genconfig
+++ b/applications/luci-app-statistics/root/usr/bin/stat-genconfig
@@ -235,13 +235,13 @@ function _bool( s, n, nopad )
local pad = ""
if not nopad then pad = "\t" end
- if s and s == "1" then
- str = pad .. n .. " true"
- else
- str = pad .. n .. " false"
+ if s == "1" then
+ str = pad .. n .. " true\n"
+ elseif s == "0" then
+ str = pad .. n .. " false\n"
end
- return str .. "\n"
+ return str
end
function _string( s, n, nopad )