summaryrefslogtreecommitdiffstats
path: root/syslog-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-10-03 12:42:13 +0000
committerTed Trask <ttrask01@yahoo.com>2008-10-03 12:42:13 +0000
commited1cb667362918a39dd62b7fb77d8da4293d27ae (patch)
tree4f1c68ceb04c30950260b37c9efe3ccfb26908b5 /syslog-model.lua
parent9663a8b2e44d0b1647a7a530873adcf7ea577fed (diff)
downloadacf-alpine-baselayout-ed1cb667362918a39dd62b7fb77d8da4293d27ae.tar.bz2
acf-alpine-baselayout-ed1cb667362918a39dd62b7fb77d8da4293d27ae.tar.xz
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/alpine-baselayout/trunk@1539 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'syslog-model.lua')
-rw-r--r--syslog-model.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/syslog-model.lua b/syslog-model.lua
index 2f5c4a0..541d541 100644
--- a/syslog-model.lua
+++ b/syslog-model.lua
@@ -50,7 +50,7 @@ local writeconfig = function (config)
end
end
- fs.write_file(configfile, format.update_configfile2(fs.read_file(configfile) or "", "", variable, '"'..format.table_to_opts(configdata) .. '"'))
+ fs.write_file(configfile, format.update_ini_file(fs.read_file(configfile) or "", "", variable, '"'..format.table_to_opts(configdata) .. '"'))
end
local makeconfig = function(configcontent)
@@ -175,7 +175,7 @@ end
function getconfig()
local config = {}
if (fs.is_file(configfile)) then
- local configcontent = format.opts_to_table(string.sub((format.parse_configfile2(fs.read_file(configfile), "", "SYSLOGD_OPTS") or ""),2,-2))
+ local configcontent = format.opts_to_table(string.sub((format.parse_ini_file(fs.read_file(configfile), "", "SYSLOGD_OPTS") or ""),2,-2))
config = makeconfig(configcontent)
else
config = makeconfig()
@@ -201,7 +201,7 @@ end
function update_filedetails (filedetails)
-- Validation before writing
filedetails.value.filecontent.value = string.gsub(format.dostounix(filedetails.value.filecontent.value), "\n+$", "")
- local configcontent = format.opts_to_table(string.sub((format.parse_configfile2(filedetails.value.filecontent.value, "", "SYSLOGD_OPTS") or ""),2,-2))
+ local configcontent = format.opts_to_table(string.sub((format.parse_ini_file(filedetails.value.filecontent.value, "", "SYSLOGD_OPTS") or ""),2,-2))
local config = makeconfig(configcontent)
local success, errtxt
success, config = validateconfig(config)
@@ -216,7 +216,7 @@ function update_filedetails (filedetails)
end
end
filedetails.value.filecontent.errtxt = table.concat(errormessages, "\n")
- filedetials.errtxt = "Failed to set configuration"
+ filedetails.errtxt = "Failed to set configuration"
end
return filedetails