summaryrefslogtreecommitdiffstats
path: root/clamsmtp-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-10-18 20:10:54 +0000
committerTed Trask <ttrask01@yahoo.com>2013-10-18 20:10:54 +0000
commit99fb287a390e20366f64a9ca3a8e9948a69ad2b2 (patch)
tree8c7335c17e35cea8e8b476f9d31d24e7efc9a565 /clamsmtp-model.lua
parent4f741f028bcecdcb11da76ffd3156ca0dac87870 (diff)
downloadacf-clamsmtp-99fb287a390e20366f64a9ca3a8e9948a69ad2b2.tar.bz2
acf-clamsmtp-99fb287a390e20366f64a9ca3a8e9948a69ad2b2.tar.xz
Remove all calls to 'module' in preparation for move to Lua 5.2
Use mymodule parameter for module definition. This was also helpful in revealing places where the code relied on the global environment.
Diffstat (limited to 'clamsmtp-model.lua')
-rw-r--r--clamsmtp-model.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/clamsmtp-model.lua b/clamsmtp-model.lua
index f598191..ac09576 100644
--- a/clamsmtp-model.lua
+++ b/clamsmtp-model.lua
@@ -1,4 +1,4 @@
-module(..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -18,26 +18,28 @@ local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
-- ################################################################################
-- PUBLIC FUNCTIONS
-function get_startstop(self, clientdata)
+function mymodule.get_startstop(self, clientdata)
return modelfunctions.get_startstop(processname)
end
-function startstop_service(self, startstop, action)
+function mymodule.startstop_service(self, startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
-function getstatus()
+function mymodule.getstatus()
return modelfunctions.getstatus(processname, packagename, "ClamSMTP Status")
end
-function getstatusdetails()
+function mymodule.getstatusdetails()
return cfe({ type="longtext", value="", label="ClamSMTP Status Details" })
end
-function get_filedetails()
+function mymodule.get_filedetails()
return modelfunctions.getfiledetails(configfile)
end
-function update_filedetails(self, filedetails)
+function mymodule.update_filedetails(self, filedetails)
return modelfunctions.setfiledetails(self, filedetails, {configfile})
end
+
+return mymodule