Commit 5736ed4b authored by Ted Trask's avatar Ted Trask

Replaced io.popen with modelfunctions.run_executable

parent e5b28b8f
......@@ -397,13 +397,11 @@ function startstop_service(self, startstop, action)
if action and (action:lower() == "run" or action:lower() == "test") then
local cmd
if action:lower() == "run" then
cmd = 'su -s /bin/sh -c "/usr/bin/fetchmail -d0 -v --nosyslog -f '..configfile..' 2>&1" - fetchmail'
cmd = "/usr/bin/fetchmail -d0 -v --nosyslog -f "..configfile
elseif action:lower() == "test" then
cmd = 'su -s /bin/sh -c "/usr/bin/fetchmail -d0 -v -k --nosyslog -f '..configfile..' 2>&1" - fetchmail'
cmd = "/usr/bin/fetchmail -d0 -v -k --nosyslog -f "..configfile
end
local f = io.popen(cmd)
startstop.descr = f:read("*a")
f:close()
startstop.descr, startstop.errtxt = modelfunctions.run_executable({"su", "-s", "/bin/sh", "-c", cmd, "-", "fetchmail"}, true)
else
startstop.errtxt = "Invalid action"
end
......
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