+ if (@{$cluster->{servers}} > 1 && grep { $_->{status} eq "up" } @{$cluster->{servers}})
+ {
+ $gdnsweightedfile->print("${name} => {\n");
+
+ while (my($index,$server) = each @{$cluster->{servers}})
+ {
+ if ($server->{status} eq "up")
+ {
+ my $number = sprintf("%02d", $index + 1);
+ my $requests = $server->{requests};
+
+ if (my $cname = $server->{cname})
+ {
+ $gdnsweightedfile->print(" ${name}-${number} = [ ${cname}., ${requests} ]\n");
+ }
+ else
+ {
+ $gdnsweightedfile->print(" ${name}-${number} = [ ${name}-${number}.${zone}.openstreetmap.org., ${requests} ]\n");
+ }
+ }
+ }
+
+ $gdnsweightedfile->print("}\n");
+
+ $gdnsresourcefile->print(" ${name} => %weighted!${name}\n");
+ }
+ elsif (my $cname = $cluster->{cname})
+ {
+ $gdnsresourcefile->print(" ${name} => ${cname}.\n");
+ }
+ else
+ {
+ $gdnsresourcefile->print(" ${name} => ${name}.${zone}.openstreetmap.org.\n");
+ }