summaryrefslogtreecommitdiffstats
path: root/chrony-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-12-02 14:18:26 +0000
committerTed Trask <ttrask01@yahoo.com>2008-12-02 14:18:26 +0000
commitc1c9ce5a4bb344694d1e617ee5bbdc72e88bcb3c (patch)
treea1f3c88c561bc6d9c6a13c56fbae614534b85de6 /chrony-model.lua
parentca8fdaf2abd1e3d74d94e03d792940cac02d7c04 (diff)
downloadacf-chrony-c1c9ce5a4bb344694d1e617ee5bbdc72e88bcb3c.tar.bz2
acf-chrony-c1c9ce5a4bb344694d1e617ee5bbdc72e88bcb3c.tar.xz
Modify chrony to detect comments more accurately.
git-svn-id: svn://svn.alpinelinux.org/acf/chrony/trunk@1617 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'chrony-model.lua')
-rw-r--r--chrony-model.lua23
1 files changed, 10 insertions, 13 deletions
diff --git a/chrony-model.lua b/chrony-model.lua
index f2be0b1..c7f0a73 100644
--- a/chrony-model.lua
+++ b/chrony-model.lua
@@ -29,19 +29,16 @@ function getconfig()
output.KEYFILE = cfe({value="/etc/chrony/chrony.keys", label="keyfile"})
output.LOGDIR = cfe({value="/var/log/chrony", label="logdir"})
---require ("html")
-
- local config = format.parse_configfile(fs.read_file(configfile))
- if config then
- output.SERVER.value = config.server or output.SERVER.value
- output.ALLOW.value = config.allow or output.ALLOW.value
- output.DRIFTFILE.value = config.driftfile or output.DRIFTFILE.value
- output.KEYFILE.value = config.keyfile or output.KEYFILE.value
- output.LOGDIR.value = config.logdir or output.LOGDIR.value
- end
---APP.logevent(html.cfe_unpack(output))
---APP.logevent(html.cfe_unpack(config))
-return cfe({ type="group", value=output, label="Chrony Config" })
+ local config = format.parse_configfile(fs.read_file(configfile), "[!;#%]")
+ if config then
+ output.SERVER.value = config.server or output.SERVER.value
+ output.ALLOW.value = config.allow or output.ALLOW.value
+ output.DRIFTFILE.value = config.driftfile or output.DRIFTFILE.value
+ output.KEYFILE.value = config.keyfile or output.KEYFILE.value
+ output.LOGDIR.value = config.logdir or output.LOGDIR.value
+ end
+
+ return cfe({ type="group", value=output, label="Chrony Config" })
end