diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-01-26 21:54:28 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-01-26 21:54:28 +0000 |
commit | 45ea340efc6caeb5fd07ab96d1ab8139e1a6ec57 (patch) | |
tree | fc71142103964d067af59a6470f6adc02a3c5e6b | |
parent | 3a9d85de30b24ec9aba396ce5f89bd063ae80970 (diff) | |
download | acf-shorewall-45ea340efc6caeb5fd07ab96d1ab8139e1a6ec57.tar.bz2 acf-shorewall-45ea340efc6caeb5fd07ab96d1ab8139e1a6ec57.tar.xz |
More work to remove unnecessary popen calls.
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@1696 ab2d0c66-481e-0410-8bed-d214d4d58bed
-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 () |