X-Git-Url: https://git.openstreetmap.org./dns.git/blobdiff_plain/737e782ae6f889765e6ce9d4257f01d12a3019a5..cd71c84ea3565cd553b26cc1b8bd2cf86168b396:/bin/mkgeo diff --git a/bin/mkgeo b/bin/mkgeo index ce0ff2f..8cb4687 100755 --- a/bin/mkgeo +++ b/bin/mkgeo @@ -259,11 +259,11 @@ if (!defined($gdnsname)) if (my $default = $cluster->{default}) { - output_server($zonefile, "${default}.${zone}", $cluster); + output_server($zonefile, "${default}.${zone}", $cluster, 0); } elsif (exists($cluster->{default})) { - output_server($zonefile, "${zone}", $cluster); + output_server($zonefile, "${zone}", $cluster, 0); } } } @@ -275,11 +275,11 @@ foreach my $cluster (sort { $a->{name} cmp $b->{name} } values %$clusters) if (@{$cluster->{servers}} > 1) { - output_server($zonefile, "${name}-%02d.${zone}", $cluster); + output_server($zonefile, "${name}-%02d.${zone}", $cluster, 1); } else { - output_server($zonefile, "${name}.${zone}", $cluster); + output_server($zonefile, "${name}.${zone}", $cluster, 1); } } @@ -527,10 +527,11 @@ sub output_server my $zonefile = shift; my $name = shift; my $cluster = shift; + my $all = shift; while (my($index,$server) = each @{$cluster->{servers}}) { - if ($server->{status} eq "up") + if ($all || $server->{status} eq "up") { $zonefile->printf(" A(\"${name}\", \"$server->{ipv4}\", TTL(\"10m\")),\n", $index + 1);