summaryrefslogtreecommitdiffstats
path: root/dnsmasq-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'dnsmasq-model.lua')
-rw-r--r--dnsmasq-model.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/dnsmasq-model.lua b/dnsmasq-model.lua
index 287947d..47176ef 100644
--- a/dnsmasq-model.lua
+++ b/dnsmasq-model.lua
@@ -20,12 +20,12 @@ local function update_file (file, search_name, value_in)
if not file or not search_name or search_name == "" then
return file, false
end
-
+
-- Since we clear out the value, this prevents us from changing parent's value
local value = value_in
if type(value_in) == "table" then
value = {}
- for i,val in ipairs(value_in) do
+ for i,val in ipairs(value_in) do
value[#value + 1] = val
end
end
@@ -143,7 +143,7 @@ local function validateconfig(self, config)
function testlist(param, test, errtxt)
if #param.value > 0 then
- for i,val in ipairs(param.value) do
+ for i,val in ipairs(param.value) do
if test(val) then
param.errtxt = errtxt
success = false
@@ -159,7 +159,7 @@ local function validateconfig(self, config)
success = false
end
end
-
+
local interfaces = {}
local interfacescontroller = self:new("alpine-baselayout/interfaces")
local ints = interfacescontroller.model.get_interfaces()
@@ -180,7 +180,7 @@ local function validateconfig(self, config)
-- validate ip address only if dns filtering is enabled
testtext(config.value.dns_default_address, function(v) return not validator.is_ipv4(v) end, "Invalid IP Address")
end
-
+
return success, config
end
@@ -270,7 +270,7 @@ end
function mymodule.get_startstop(self, clientdata)
return modelfunctions.get_startstop(processname)
end
-
+
function mymodule.startstop_service(self, startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
@@ -319,7 +319,7 @@ function mymodule.setconfig(self, config)
-- dns filtering
local conf_file_value = set_dns_filtering(file, config.value.dns_filtering.value)
file = update_file(file,"conf-file",conf_file_value)
- fs.write_file(configfile, file)
+ fs.write_file(configfile, file)
else
config.errtxt = "Failed to set config"
end