diff options
Diffstat (limited to 'fetchmail-model.lua')
-rw-r--r-- | fetchmail-model.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fetchmail-model.lua b/fetchmail-model.lua index d7a4e53..bfe07b9 100644 --- a/fetchmail-model.lua +++ b/fetchmail-model.lua @@ -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 |