From 50ba1c22bc56b7cc8fd2b5dfd4d6db1e0fb4a0d4 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 2 Jan 2013 00:29:35 +0000 Subject: Replace io.popen with modelfunctions.run_executable --- shorewall-model.lua | 6 ++---- 1 file 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) -- cgit v1.2.3