Commit aba173b4 authored by Ted Trask's avatar Ted Trask

Modified format library. parse_configfile2, update_configfile2, get_section,...

Modified format library.  parse_configfile2, update_configfile2, get_section, and set_section became parse_ini_file, update_ini_file, get_ini_section, and set_ini_section.  Updated all code that used these functions.

git-svn-id: svn://svn.alpinelinux.org/acf/dnscache/trunk@1539 ab2d0c66-481e-0410-8bed-d214d4d58bed
parent a185bea3
......@@ -68,7 +68,7 @@ function getstatus()
end
function getconfig()
local conf = format.parse_configfile2(fs.read_file(configfile), "") or {}
local conf = format.parse_ini_file(fs.read_file(configfile), "") or {}
local output = {}
output.IPSEND = cfe({ value = conf.IPSEND or "", label="IP address for requests",
descr="Use 0.0.0.0 for default address" })
......@@ -84,13 +84,13 @@ function setconfig(config)
if success then
local file = fs.read_file(configfile)
file = format.update_configfile2(file,"","IPSEND",config.value.IPSEND.value)
file = format.update_configfile2(file,"","CACHESIZE",config.value.CACHESIZE.value)
file = format.update_configfile2(file,"","IP",config.value.IP.value)
file = format.update_ini_file(file,"","IPSEND",config.value.IPSEND.value)
file = format.update_ini_file(file,"","CACHESIZE",config.value.CACHESIZE.value)
file = format.update_ini_file(file,"","IP",config.value.IP.value)
if config.value.FORWARDONLY.value then
file = format.update_configfile2(file,"","FORWARDONLY","true")
file = format.update_ini_file(file,"","FORWARDONLY","true")
else
file = format.update_configfile2(file,"","FORWARDONLY","")
file = format.update_ini_file(file,"","FORWARDONLY","")
end
fs.write_file(configfile, file)
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment