summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tinydns-model.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/tinydns-model.lua b/tinydns-model.lua
index f84b103..a9abb90 100644
--- a/tinydns-model.lua
+++ b/tinydns-model.lua
@@ -2,7 +2,6 @@ module(..., package.seeall)
-- Load libraries
require("modelfunctions")
-require("getopts")
require("fs")
require("format")
require("validator")
@@ -168,7 +167,7 @@ end
function getconfig()
local config = {}
- local listenaddr = getopts.getoptsfromfile(configfile,"","IP") or ""
+ local listenaddr = format.parse_configfile2(fs.read_file(configfile),"","IP") or ""
config.listen = cfe({
label="IP address to listen on",
value=listenaddr,
@@ -187,7 +186,7 @@ function setconfig(conf)
conf.value.listen.errtxt = errtxt
conf.errtxt = "Failed to set configuration"
else
- getopts.setoptsinfile(configfile,"","IP",conf.value.listen.value)
+ fs.write_file(configfile, format.update_configfile2(fs.read_file(configfile) or "","","IP",conf.value.listen.value))
end
return conf