push @servers, $server;
}
}
- else
+ elsif ($cluster->{requests} > 0)
{
my $server = {
cluster => $cluster,
push @servers, $server;
}
+ else
+ {
+ $cluster->{servers} = [];
+ }
$cluster->{name} = $name;
$cluster->{status} = "down";
}
}
+# Abort if no servers at all are up
+exit 0 unless grep { $_->{status} eq "up" } values(%$clusters);
+
# Create target origins object
my $targetorigins = {};
my $continent = "";
$gdnsmapfile->print("${gdnsname} => {\n");
- $gdnsmapfile->print(" geoip2_db => /usr/share/GeoIP/GeoLite2-Country.mmdb\n");
+ $gdnsmapfile->print(" geoip2_db => /etc/gdnsd/geoip/GeoLite2-Country.mmdb\n");
$gdnsmapfile->print(" datacenters => [" . join(",", sort(keys(%$clusters))) . "]\n");
$gdnsmapfile->print(" map => {\n");
$gdnsmapfile->print(" default => [" . join(",", sort(map { $_->{name} } grep { $_->{default} } values(%$clusters))) . "]\n");