Commit aa8f6a9b authored by Ted Trask's avatar Ted Trask

Fixed startstop to match new method

parent 80f25c72
......@@ -388,12 +388,13 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
function startstop_service(action)
local result = modelfunctions.startstop_service(processname, action)
table.insert(result.value.actions.value, "Run")
table.insert(result.value.actions.value, "Test")
function get_startstop(clientdata)
local actions = {"Run", "Test"}
return cfe({ type="group", label="Management", value={}, option=actions })
end
function startstop_service(startstop, action)
if action and (action:lower() == "run" or action:lower() == "test") then
result.value.result.errtxt = nil
local cmd
if action:lower() == "run" then
cmd = 'su -s /bin/sh -c "/usr/bin/fetchmail -d0 -v --nosyslog -f '..configfile..' 2>&1" - fetchmail'
......@@ -401,10 +402,12 @@ function startstop_service(action)
cmd = 'su -s /bin/sh -c "/usr/bin/fetchmail -d0 -v -k --nosyslog -f '..configfile..' 2>&1" - fetchmail'
end
local f = io.popen(cmd)
result.value.result.value = f:read("*a")
startstop.descr = f:read("*a")
f:close()
else
startstop.errtxt = "Invalid action"
end
return result
return startstop
end
function getstatus()
......
../startstop-html.lsp
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment