summaryrefslogtreecommitdiffstats
path: root/openntpd-read-html.lsp
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2007-12-04 16:51:33 +0000
committerMika Havela <mika.havela@gmail.com>2007-12-04 16:51:33 +0000
commit0fd9a5752c73ee508f89fd454ca372b97a6a9c95 (patch)
treeff0658093da625c57cb5dc12383cb5b7dbaeeb19 /openntpd-read-html.lsp
parentb15f9ef2aea50f99fb2926b677a546c5aabc0c70 (diff)
downloadacf-openntpd-0fd9a5752c73ee508f89fd454ca372b97a6a9c95.tar.bz2
acf-openntpd-0fd9a5752c73ee508f89fd454ca372b97a6a9c95.tar.xz
Bugfix when servers or server is not defined in config.
git-svn-id: svn://svn.alpinelinux.org/acf/openntpd/trunk@407 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openntpd-read-html.lsp')
-rw-r--r--openntpd-read-html.lsp15
1 files changed, 8 insertions, 7 deletions
diff --git a/openntpd-read-html.lsp b/openntpd-read-html.lsp
index 73caead..5c88cbc 100644
--- a/openntpd-read-html.lsp
+++ b/openntpd-read-html.lsp
@@ -27,12 +27,14 @@
<dt>Timeserver hosts...</dt>
<dd>
<select name="" size="3" style="width:200px;">
-<? for i = 1, table.maxn(view.filecontent.servers) do ?>
+<? if (view.filecontent.servers) then
+for i = 1, table.maxn(view.filecontent.servers) do ?>
<option name="<? io.write(view.filecontent.servers[i].value) ?>"><? io.write(view.filecontent.servers[i].value) ?></option>
-<? end ?>
-<? for i = 1, table.maxn(view.filecontent.server) do ?>
+<? end end ?>
+<? if (view.filecontent.server) then
+for i = 1, table.maxn(view.filecontent.server) do ?>
<option name="<? io.write(view.filecontent.server[i].value) ?>"><? io.write(view.filecontent.server[i].value) ?></option>
-<? end ?>
+<? end end ?>
</select><BR>
In most cases you could use <i><b>pool.ntp.org</b></i> or <i><b>[countryname].pool.ntp.org</i></b> (if listed in <i><b>http://www.pool.ntp.org/</b></i>).
</dd>
@@ -47,11 +49,10 @@ In most cases you could use <i><b>pool.ntp.org</b></i> or <i><b>[countryname].po
<dt>Listen on address...</dt>
<dd>
<select name="" size="3" style="width:200px;">
-<? ---[[
-if (view.filecontent.listen) then
+<? if (view.filecontent.listen) then
for i = 1, table.maxn(view.filecontent.listen) do ?>
<option name="<? io.write(view.filecontent.listen[i].value) ?>"><? io.write(view.filecontent.listen[i].value) ?></option>
-<? end end--]]?>
+<? end end ?>
</select><BR>Empty list = Not listening or acting as server; "*" = All local addresses
</dd>