summaryrefslogtreecommitdiffstats
path: root/lbu-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lbu-model.lua')
-rw-r--r--lbu-model.lua25
1 files changed, 23 insertions, 2 deletions
diff --git a/lbu-model.lua b/lbu-model.lua
index 7757332..c3d20c4 100644
--- a/lbu-model.lua
+++ b/lbu-model.lua
@@ -51,8 +51,8 @@ end
local function getincexl(state)
local incexl = {}
if (string.lower(state) == "include") or (string.lower(state) == "exclude") then
- local f = io.popen("/sbin/lbu " .. state .. " -l 2>&1", "r")
- if not (f) then return ciphers end
+ local f = io.popen("/sbin/lbu " .. string.lower(state) .. " -l 2>&1", "r")
+ if not (f) then return incexl end
for line in f:lines() do
table.insert(incexl,tostring(line))
end
@@ -108,6 +108,27 @@ function getconfig ()
-- config["debug"] = getciphers()
return config
end
+
+function lbuincexcl(self,state,value,addremove)
+ local incexl = nil
+-- local addremove
+ if (string.lower(addremove or "") == "add") then
+ addremove = ""
+ elseif (string.lower(addremove or "") == "remove") then
+ addremove = "-r"
+ else
+ return "Function setincexl() - Invalid option! Use add|remove when calling this function!"
+ end
+ if (string.lower(state) == "include") or (string.lower(state) == "exclude") then
+ local f = io.popen("/sbin/lbu " .. string.lower(state) .. " " .. addremove .. " -v " .. value .." 2>&1", "r")
+ if not (f) then return incexl end
+ incexl = f:read("*a")
+ f:close()
+ else
+ return "Function setincexl() - Invalid command! Use include|exclude when calling this function!"
+ end
+ return incexl
+end
-- ################################################################################
-- OLD FUNCTIONS