diff options
Diffstat (limited to 'openntpd-model.lua')
-rw-r--r-- | openntpd-model.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/openntpd-model.lua b/openntpd-model.lua index 44139c1..f5607f5 100644 --- a/openntpd-model.lua +++ b/openntpd-model.lua @@ -1,4 +1,4 @@ -module (..., package.seeall) +local mymodule = {} -- Load libraries modelfunctions = require("modelfunctions") @@ -52,19 +52,19 @@ end -- ################################################################################ -- 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, "OpenNTPD Status") end -function getstatusdetails() +function mymodule.getstatusdetails() local status = {} status.timechanged = cfe({ value=last_time_change(), label="Previous time adjustment" }) @@ -73,7 +73,7 @@ function getstatusdetails() return cfe({ type="group", value=status, label="OpenNTPD Detailed Status" }) end -function read_config () +function mymodule.read_config () local config = {} config.server = cfe({ type="list", value={}, label="Single servers", descr="List of server IP addresses/hostnames. OpenNTPD will attempt to synchronize to one resolved address for each hostname entry.", seq=3 }) config.servers = cfe({ type="list", value={}, label="Multiple servers", descr="List of server IP addresses/hostnames. OpenNTPD will attempt to synchronize to all resolved addresses for each hostname entry.", seq=4 }) @@ -99,7 +99,7 @@ function read_config () return cfe({ type="group", value=config, label="OpenNTPD Config" }) end -function update_config(self, config) +function mymodule.update_config(self, config) local success, config = validate_config(config) if success then @@ -154,11 +154,12 @@ function update_config(self, config) return config 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 |