diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-01-01 16:54:18 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-01-01 16:54:18 +0000 |
commit | 5736ed4bbd066e4675977d61a4ea83a146dd710d (patch) | |
tree | 87a5a97eb7f7b39dacca37e464341f8e57c87d0a /fetchmail-model.lua | |
parent | e5b28b8fb4846f6a67b54f30333d77d1c1ca1355 (diff) | |
download | acf-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.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 |