diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-01-02 00:29:35 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-01-02 00:29:35 +0000 |
commit | 50ba1c22bc56b7cc8fd2b5dfd4d6db1e0fb4a0d4 (patch) | |
tree | 915de4c924af03bb2ffaf4e380e63c3d2697417f | |
parent | 6b8f80def7219fd16f6b82338aec2d378c110687 (diff) | |
download | acf-shorewall-50ba1c22bc56b7cc8fd2b5dfd4d6db1e0fb4a0d4.tar.bz2 acf-shorewall-50ba1c22bc56b7cc8fd2b5dfd4d6db1e0fb4a0d4.tar.xz |
Replace io.popen with modelfunctions.run_executable
-rw-r--r-- | shorewall-model.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/shorewall-model.lua b/shorewall-model.lua index d438b66..ca70e89 100644 --- a/shorewall-model.lua +++ b/shorewall-model.lua @@ -175,10 +175,8 @@ function getstatus() end function getstatusdetails() - local f = io.popen("/sbin/shorewall status 2>%1") - local programstate = f:read("*a") or "" - f:close() - return cfe({ value=programstate, label="Shorewall status report" }) + local programstate, errtxt = modelfunctions.run_executable({"shorewall", "status"}, true) + return cfe({ value=programstate, label="Shorewall status report", errtxt=errtxt }) end function get_startstop(self, clientdata) |