* luci/app/statistics: fix syntax of collectd Exec plugin config
This commit is contained in:
parent
9033d9b7be
commit
9f19574ae0
1 changed files with 10 additions and 4 deletions
|
@ -94,11 +94,17 @@ function config_exec( c )
|
||||||
for key, type in pairs({ Exec="collectd_exec_input", NotificationExec="collectd_exec_notify" }) do
|
for key, type in pairs({ Exec="collectd_exec_input", NotificationExec="collectd_exec_notify" }) do
|
||||||
if sections[s][".type"] == type then
|
if sections[s][".type"] == type then
|
||||||
|
|
||||||
cmd = sections[s].cmdline
|
cmd = sections[s].cmdline
|
||||||
user = sections[s].cmduser or "nobody"
|
|
||||||
group = sections[s].cmdgroup or "nogroup"
|
|
||||||
|
|
||||||
str = str .. "\t" .. key .. " " .. user .. ":" .. group .. ' "' .. cmd .. "\"\n"
|
if cmd then
|
||||||
|
cmd = cmd:gsub("^%s+", ""):gsub("%s+$", "")
|
||||||
|
user = sections[s].cmduser or "nobody"
|
||||||
|
group = sections[s].cmdgroup
|
||||||
|
|
||||||
|
str = str .. "\t" .. key .. ' "' ..
|
||||||
|
user .. ( group and ":" .. group or "" ) .. '" "' ..
|
||||||
|
cmd:gsub('%s+', '" "') .. '"\n'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue