summaryrefslogtreecommitdiffstats
path: root/fetchmail-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-01-01 16:54:18 +0000
committerTed Trask <ttrask01@yahoo.com>2013-01-01 16:54:18 +0000
commit5736ed4bbd066e4675977d61a4ea83a146dd710d (patch)
tree87a5a97eb7f7b39dacca37e464341f8e57c87d0a /fetchmail-model.lua
parente5b28b8fb4846f6a67b54f30333d77d1c1ca1355 (diff)
downloadacf-fetchmail-5736ed4bbd066e4675977d61a4ea83a146dd710d.tar.bz2
acf-fetchmail-5736ed4bbd066e4675977d61a4ea83a146dd710d.tar.xz
Replaced io.popen with modelfunctions.run_executable
Diffstat (limited to 'fetchmail-model.lua')
-rw-r--r--fetchmail-model.lua8
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