Only include servers which are up in the weighted server list
authorTom Hughes <tom@compton.nu>
Fri, 6 Dec 2019 09:10:30 +0000 (09:10 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 6 Dec 2019 09:10:30 +0000 (09:10 +0000)
bin/mkgeo

index 6868af07ac7b1b00a04758dc89e892a0b2d9fd3a..2e0ac009c192c1efc44dbab4da62ebee729ab6ab 100755 (executable)
--- a/bin/mkgeo
+++ b/bin/mkgeo
@@ -339,10 +339,13 @@ if (defined($gdnsname))
 
             while (my($index,$server) = each @{$cluster->{servers}})
             {
-                my $number = sprintf("%02d", $index + 1);
-                my $bandwidth = $server->{bandwidth};
+                if ($server->{status} eq "up")
+                {
+                    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}., ${bandwidth} ]\n");
+                }
             }
 
             $gdnsweightedfile->print("}\n");