summaryrefslogtreecommitdiffstats
path: root/clamav-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'clamav-model.lua')
-rw-r--r--clamav-model.lua39
1 files changed, 39 insertions, 0 deletions
diff --git a/clamav-model.lua b/clamav-model.lua
new file mode 100644
index 0000000..90e2fa5
--- /dev/null
+++ b/clamav-model.lua
@@ -0,0 +1,39 @@
+module(..., package.seeall)
+
+-- Load libraries
+require("modelfunctions")
+require("fs")
+require("format")
+
+-- Set variables
+local configfile = "/etc/clamd.conf"
+local processname = "clamd"
+local packagename = "clamav"
+
+local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin "
+
+-- ################################################################################
+-- LOCAL FUNCTIONS
+
+-- ################################################################################
+-- PUBLIC FUNCTIONS
+
+function startstop_service(action)
+ return modelfunctions.startstop_service(processname, action)
+end
+
+function getstatus()
+ return modelfunctions.getstatus(processname, packagename, "ClamAV Status")
+end
+
+function getstatusdetails()
+ return cfe({ type="longtext", value="", label="ClamAV Status Details" })
+end
+
+function get_filedetails()
+ return modelfunctions.getfiledetails(configfile)
+end
+
+function update_filedetails(filedetails)
+ return modelfunctions.setfiledetails(filedetails, {configfile})
+end