diff options
-rw-r--r-- | shorewall-model.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/shorewall-model.lua b/shorewall-model.lua index 694bb56..1d78ebb 100644 --- a/shorewall-model.lua +++ b/shorewall-model.lua @@ -193,10 +193,12 @@ function startstop_service(action) end function configcheck () - local f = io.popen("/bin/echo -n '>> Check starts at: ';/bin/date; /bin/echo; /etc/init.d/shorewall check 2>&1; /bin/echo; /bin/echo -n '>> Check stops at: '; /bin/date;") - local checkresult = f:read("*a") + local checkresult = {">> Check starts at: " .. os.date() .. "\n"} + local f = io.popen("/etc/init.d/shorewall check 2>&1") + checkresult[2] = f:read("*a") or "" f:close() - return cfe({ type="longtext", value=checkresult, label="Result of checking config" }) + checkresult[3] = ">> Check stops at: "..os.date() + return cfe({ type="longtext", value=table.concat(checkresult, "\n"), label="Result of checking config" }) end function getlogfile () |