summaryrefslogtreecommitdiffstats
path: root/dovecot-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-12-31 21:15:25 +0000
committerTed Trask <ttrask01@yahoo.com>2008-12-31 21:15:25 +0000
commitba47f1e7c2d7494bbc9c424c4d40e100addf3005 (patch)
tree4797b867f9ff25e31f1c9b2ee4e8667e62afd36d /dovecot-model.lua
downloadacf-dovecot-ba47f1e7c2d7494bbc9c424c4d40e100addf3005.tar.bz2
acf-dovecot-ba47f1e7c2d7494bbc9c424c4d40e100addf3005.tar.xz
Added dovecot controller with basic functionality.
git-svn-id: svn://svn.alpinelinux.org/acf/dovecot/trunk@1658 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'dovecot-model.lua')
-rw-r--r--dovecot-model.lua39
1 files changed, 39 insertions, 0 deletions
diff --git a/dovecot-model.lua b/dovecot-model.lua
new file mode 100644
index 0000000..06dc180
--- /dev/null
+++ b/dovecot-model.lua
@@ -0,0 +1,39 @@
+module(..., package.seeall)
+
+-- Load libraries
+require("modelfunctions")
+require("fs")
+require("format")
+
+-- Set variables
+local configfile = "/etc/dovecot/dovecot.conf"
+local processname = "dovecot"
+local packagename = "dovecot"
+
+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, "Dovecot Status")
+end
+
+function getstatusdetails()
+ return cfe({ type="longtext", value="", label="Dovecot Status Details" })
+end
+
+function get_filedetails()
+ return modelfunctions.getfiledetails(configfile)
+end
+
+function update_filedetails(filedetails)
+ return modelfunctions.setfiledetails(filedetails, {configfile})
+end