summaryrefslogtreecommitdiffstats
path: root/dnsmasq-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dnsmasq-model.lua')
-rw-r--r--dnsmasq-model.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/dnsmasq-model.lua b/dnsmasq-model.lua
index 181f2cd..c6e4ddd 100644
--- a/dnsmasq-model.lua
+++ b/dnsmasq-model.lua
@@ -1,4 +1,4 @@
-module(..., package.seeall)
+local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
@@ -267,19 +267,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, "DNS Masq Status")
end
-function getconfig()
+function mymodule.getconfig()
local conf = parse_file(fs.read_file(configfile) or "") or {}
local dns_filtering = {}
dns_filtering.enabled = dns_filtering_is_enabled(conf)
@@ -303,7 +303,7 @@ function getconfig()
return cfe({ type="group", value=output, label="DNS Masq Config" })
end
-function setconfig(self, config)
+function mymodule.setconfig(self, config)
local success, config = validateconfig(self, config)
if success then
@@ -330,16 +330,18 @@ function setconfig(self, config)
return config
end
-function getconfigfile()
+function mymodule.getconfigfile()
-- FIXME Validate
return modelfunctions.getfiledetails(configfile)
end
-function setconfigfile(self, filedetails)
+function mymodule.setconfigfile(self, filedetails)
-- FIXME Validate
return modelfunctions.setfiledetails(self, filedetails, {configfile})
end
-function getleases()
+function mymodule.getleases()
return modelfunctions.getfiledetails(leasefile)
end
+
+return mymodule