summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-05-07 17:37:37 +0000
committerTed Trask <ttrask01@yahoo.com>2008-05-07 17:37:37 +0000
commit73bc3b398ac6362165fbdaaa876f11a6c62f89fd (patch)
tree897e7e3f42e65a21f0ecd682ca7d7f880319cde8
parent5a557232e6593729e780654d64c2ffd4ee095978 (diff)
downloadacf-dnscache-73bc3b398ac6362165fbdaaa876f11a6c62f89fd.tar.bz2
acf-dnscache-73bc3b398ac6362165fbdaaa876f11a6c62f89fd.tar.xz
Rewrote getopts.getoptsfromfile function to handle more complicated config files and removed getopts.getoptsfromfile_onperline function
git-svn-id: svn://svn.alpinelinux.org/acf/dnscache/trunk@1111 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--dnscache-model.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/dnscache-model.lua b/dnscache-model.lua
index a4835ea..aad55d8 100644
--- a/dnscache-model.lua
+++ b/dnscache-model.lua
@@ -80,12 +80,12 @@ function getstatus()
status.ip = cfe({ name="ip",
label="Listening on",
- value=config.IP,
+ value=config.IP or "",
})
status.cachesize = cfe({ name="cachesize",
label="Cache size",
- value=humanreadable(config.CACHESIZE),
+ value=humanreadable(config.CACHESIZE or ""),
})
return status
@@ -116,9 +116,9 @@ end
function getconfig()
if (fs.is_file(configfile)) then
- return getopts.getoptsfromfile(configfile)
+ return getopts.getoptsfromfile(configfile, "") or {}
end
- return false
+ return {}
end
function get_filedetails(self,num)