From: Nigel Metheringham Date: Sat, 19 May 2012 20:32:35 +0000 (+0100) Subject: Reworked to use included values function and not pairs X-Git-Url: https://git.exim.org/exim-dns.git/commitdiff_plain/ea6a45cd527a7bfd9a8d852ee11fee37e35c56c5 Reworked to use included values function and not pairs --- diff --git a/exim.org.lua b/exim.org.lua index 92fec85..2fa5d15 100644 --- a/exim.org.lua +++ b/exim.org.lua @@ -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 diff --git a/templates.lua b/templates.lua index 210ccb3..8173c89 100644 --- a/templates.lua +++ b/templates.lua @@ -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