diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-01-17 16:17:52 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-01-17 16:17:52 +0000 |
commit | dbf1f135f134ed6e51cf8b7be12b36a461ec4ab8 (patch) | |
tree | 674fe7c90034eae79a505b3aefa4307216986ac3 /lbu-model.lua | |
parent | c13c77b517defef1c030112ed3f04a65cd4d1f92 (diff) | |
download | acf-alpine-conf-dbf1f135f134ed6e51cf8b7be12b36a461ec4ab8.tar.bz2 acf-alpine-conf-dbf1f135f134ed6e51cf8b7be12b36a461ec4ab8.tar.xz |
Added functionallity to remove items from include/exclude list
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-conf/trunk@609 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'lbu-model.lua')
-rw-r--r-- | lbu-model.lua | 25 |
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 |