From 90051ddcc2f7e5aba74c55dc93a78fa900bca28f Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 7 Jan 2006 15:28:04 +0000 Subject: Write zonefile git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@45 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- Generate | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Generate b/Generate index bcc0af9..b841bbb 100755 --- a/Generate +++ b/Generate @@ -296,8 +296,22 @@ $config['hosts'].each_pair{ |name, host| } throw "Duplicate iface names" unless iface_dup_check.size == $config['hosts'].size - hostlist = $config['hosts'].values.sort{ |a,b| a['host_no'] <=> b['host_no'] } + +##################################################################### +# Create the zonefile +zonefile = File.new("#{$NAMESPACE}.zone", "w") +zonefile.puts "; zonefile snipped for #{$NAMESPACE} VPN" +zonefile.puts "; Automatically created on #{THISHOST} at #{RIGHTNOW} by #{THISPROGRAM}." +hostlist.each{ |host| + zonefile.puts "#{host['name']} IN A #{host['vpn_address']}" + zonefile.puts "#{host['name']} IN AAAA #{host['vpn_address6']}" if host['ipv6'] +} +zonefile.puts +zonefile.puts "; vim:set syn=dns:" +zonefile.close + +##################################################################### hostlist.each{ |host| peers = hostlist.find_all{ |peer| host['name'] != peer['name'] and want_connection(host, peer) and (can_connect(host,peer) or can_connect(peer,host))} -- cgit v1.2.3