Reworked to use included values function and not pairs
authorNigel Metheringham <nigel@exim.org>
Sat, 19 May 2012 20:32:35 +0000 (21:32 +0100)
committerNigel Metheringham <nigel@exim.org>
Sat, 19 May 2012 20:32:35 +0000 (21:32 +0100)
exim.org.lua
templates.lua

index 92fec85a824be2d30ca2a8a199396f8351cbed01..2fa5d155719c8a1317c762c04eae917576864eb0 100644 (file)
@@ -22,8 +22,8 @@ local ttl = 28800
 local a_record_names = {
     _a, 'www', 'mail', 'ftp', 'wiki', 'lists', 'bugs',
     'docs', 'vcs', 'git', 'dev', 'www2' }
-for i,v in pairs(a_record_names) do
-    a_and_aaaa(v,   main_ipv4, main_ipv6,       ttl)
+for val in values(a_record_names) do
+    a_and_aaaa(val, main_ipv4, main_ipv6,       ttl)
 end
 
 -- MX records
index 210ccb3624e85c7482e67be60b5edc018fe66df5..8173c8977f3cb07d22913287f44f99e723ccc9f2 100644 (file)
@@ -33,3 +33,10 @@ function a_and_aaaa(domain, ipv4, ipv6, ttl)
   a(domain, ipv4, ttl)
   aaaa(domain, ipv6, ttl)
 end
+
+
+
+function values (t)
+    local i = 0
+    return function () i = i + 1; return t[i]  end
+end