summaryrefslogtreecommitdiffstats
path: root/clamav-model.lua
diff options
context:
space:
mode:
authorttrask <ttrask@ab2d0c66-481e-0410-8bed-d214d4d58bed>2009-03-18 20:14:09 +0000
committerttrask <ttrask@ab2d0c66-481e-0410-8bed-d214d4d58bed>2009-03-18 20:14:09 +0000
commit034b5f0c6295331cc836b0a5fed2ae3e86d25611 (patch)
treedb8c961f5bb332c0cef96aa661a062921efe1854 /clamav-model.lua
parent980642caa0eeb1f01acd7d4690e27c33785b5b5b (diff)
downloadacf-clamav-034b5f0c6295331cc836b0a5fed2ae3e86d25611.tar.bz2
acf-clamav-034b5f0c6295331cc836b0a5fed2ae3e86d25611.tar.xz
Modified ClamAV to allow editing of /etc/freshclam.conf. Needed to add list.
git-svn-id: svn://svn.alpinelinux.org/acf/clamav/trunk@1732 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'clamav-model.lua')
-rw-r--r--clamav-model.lua23
1 files changed, 18 insertions, 5 deletions
diff --git a/clamav-model.lua b/clamav-model.lua
index 90e2fa5..61d7b91 100644
--- a/clamav-model.lua
+++ b/clamav-model.lua
@@ -6,9 +6,9 @@ require("fs")
require("format")
-- Set variables
-local configfile = "/etc/clamd.conf"
local processname = "clamd"
local packagename = "clamav"
+local filelist = {"/etc/clamd.conf", "/etc/freshclam.conf"}
local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin "
@@ -30,10 +30,23 @@ function getstatusdetails()
return cfe({ type="longtext", value="", label="ClamAV Status Details" })
end
-function get_filedetails()
- return modelfunctions.getfiledetails(configfile)
+function getfilelist()
+ local listed_files = {}
+
+ for i,name in ipairs(filelist) do
+ local filedetails = fs.stat(name) or {}
+ table.insert ( listed_files , {filename=name, mtime=filedetails.mtime or "---", filesize=filedetails.size or "0"} )
+ end
+
+ table.sort(listed_files, function (a,b) return (a.filename < b.filename) end )
+
+ return cfe({ type="list", value=listed_files, label="ClamAV File List" })
+end
+
+function getfiledetails(filename)
+ return modelfunctions.getfiledetails(filename, filelist)
end
-function update_filedetails(filedetails)
- return modelfunctions.setfiledetails(filedetails, {configfile})
+function updatefiledetails(filedetails)
+ return modelfunctions.setfiledetails(filedetails, filelist)
end