summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorAlexander Poslavsky <alexander.poslavsky@gmail.com>2007-11-02 07:48:38 +0000
committerAlexander Poslavsky <alexander.poslavsky@gmail.com>2007-11-02 07:48:38 +0000
commitd983c3dc087f8689d6e5be16beb952c5510df31d (patch)
tree6459d97bafe0ce13d05e9c7e629ab00f4a215009 /app
parent43e8431b2052783b8b6d8951ca9d9418f354d95b (diff)
downloadacf-core-d983c3dc087f8689d6e5be16beb952c5510df31d.tar.bz2
acf-core-d983c3dc087f8689d6e5be16beb952c5510df31d.tar.xz
shorewall directory files, show changes
git-svn-id: svn://svn.alpinelinux.org/acf/core/trunk@250 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'app')
-rw-r--r--app/cfgfile-model.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/app/cfgfile-model.lua b/app/cfgfile-model.lua
index 788ebc2..e5423d8 100644
--- a/app/cfgfile-model.lua
+++ b/app/cfgfile-model.lua
@@ -17,7 +17,6 @@ local function loadCfg()
if files ~= nil then return end
files = {}
for fname in fs.find(".*%.cfg", cfgdir) do
- print ("LOADING FILE ", fname)
f = io.open(fname, 'r')
if f then
s = f:read("*a")
@@ -34,9 +33,24 @@ local function loadCfg()
end
end
+local function getLbuStatus()
+ local ret = {}
+ local f = io.popen("/sbin/lbu status -v", "r")
+ if not f then return ret end
+ for line in f:lines() do
+ local status, name = string.match(line, "^(%S+)%s+(.+)$")
+ if status and name then
+ ret[string.gsub('/' .. name, "/+", "/")] = status
+ end
+ end
+ f:close()
+ return ret
+end
+
function list(self, app)
loadCfg()
- ret = {}
+ local ret = {}
+ local lbuStatus = getLbuStatus()
for k,v in pairs(files) do
if v.app == app then
ret[#ret+1] = {
@@ -45,6 +59,7 @@ function list(self, app)
section=v.section,
name=v.name,
descr=v.descr,
+ status=lbuStatus[v.filename]
}
end
end