summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dnscache-model.lua24
1 files changed, 5 insertions, 19 deletions
diff --git a/dnscache-model.lua b/dnscache-model.lua
index f098caf..46684cf 100644
--- a/dnscache-model.lua
+++ b/dnscache-model.lua
@@ -101,27 +101,13 @@ function setconfig(config)
end
function getconfigfile()
- local config = modelfunctions.getfiledetails(configfile)
-
- -- Validate
-
- return config
+ -- FIXME Validate
+ return modelfunctions.getfiledetails(configfile)
end
-function setconfigfile(config)
- local configcontent = string.gsub(format.dostounix(config.value.filecontent.value), "\n*$", "")
-
- -- Validate
-
- if fs.is_file(configfile) then
- fs.write_file(configfile, configcontent)
- config = modelfunctions.getfiledetails(configfile)
- else
- config.value.filecontent.value = configcontent
- config.errtxt = "Failed to set config"
- end
-
- return config
+function setconfigfile(filedetails)
+ -- FIXME Validate
+ return modelfunctions.setfiledetails(filedetails, {configfile})
end
function getIPs()