X-Git-Url: https://git.openstreetmap.org./dns.git/blobdiff_plain/191e37e08db0f5bd7f60bb1ab0137d90bcdc2125..737e782ae6f889765e6ce9d4257f01d12a3019a5:/bin/mkgeo diff --git a/bin/mkgeo b/bin/mkgeo index 400fff7..ce0ff2f 100755 --- a/bin/mkgeo +++ b/bin/mkgeo @@ -205,7 +205,7 @@ my @json; # Open output files my $zonefile = IO::File->new("> include/${zone}.js") || die "$!"; -my $jsonfile = IO::File->new("> json/${zone}.json") || die "$!"; +my $jsonfile = IO::File->new("> json/${zone}.openstreetmap.org.json") || die "$!"; # Output headers $zonefile->print("var \U${zone}\E_RECORDS = [\n"); @@ -273,12 +273,14 @@ foreach my $cluster (sort { $a->{name} cmp $b->{name} } values %$clusters) { my $name = $cluster->{name}; - output_server($zonefile, "${name}.${zone}", $cluster); - if (@{$cluster->{servers}} > 1) { output_server($zonefile, "${name}-%02d.${zone}", $cluster); } + else + { + output_server($zonefile, "${name}.${zone}", $cluster); + } } # Output the GeoJSON text @@ -348,7 +350,7 @@ if (defined($gdnsname)) my $number = sprintf("%02d", $index + 1); my $bandwidth = $server->{bandwidth}; - $gdnsweightedfile->print(" ${name}-${number} = [ ${name}-${number}.${zone}., ${bandwidth} ]\n"); + $gdnsweightedfile->print(" ${name}-${number} = [ ${name}-${number}.${zone}.openstreetmap.org., ${bandwidth} ]\n"); } } @@ -358,7 +360,7 @@ if (defined($gdnsname)) } else { - $gdnsresourcefile->print(" ${name} => ${name}.${zone}.\n"); + $gdnsresourcefile->print(" ${name} => ${name}.${zone}.openstreetmap.org.\n"); } } @@ -534,11 +536,7 @@ sub output_server if ($server->{ipv6}) { - my $ipv6 = $server->{ipv6}; - - $ipv6 =~ s/([0-9a-f]{4})(?=.)/$1:/ig; - - $zonefile->printf(" AAAA(\"${name}\", \"${ipv6}\", TTL(\"10m\")),\n", $index + 1); + $zonefile->printf(" AAAA(\"${name}\", \"$server->{ipv6}\", TTL(\"10m\")),\n", $index + 1); } } }