From f940aa881391ea62e9622c7068255c612238743d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 6 Dec 2019 09:10:30 +0000 Subject: [PATCH] Only include servers which are up in the weighted server list --- bin/mkgeo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/mkgeo b/bin/mkgeo index 6868af0..2e0ac00 100755 --- 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"); -- 2.39.5