my $targetoriginfile = shift @ARGV;
my $origins = YAML::LoadFile($originfile);
my $clusters = YAML::LoadFile($clusterfile);
my $targetoriginfile = shift @ARGV;
my $origins = YAML::LoadFile($originfile);
my $clusters = YAML::LoadFile($clusterfile);
# Output details for each country
foreach my $origin (sort { $a->{name} cmp $b->{name} } values %$origins)
{
# Output details for each country
foreach my $origin (sort { $a->{name} cmp $b->{name} } values %$origins)
{
$zonefile->print("# $origin->{name}\n");
$zonefile->print("C\L$origin->{code}\E.${zone}:$cluster->{name}.${zone}:600\n");
$zonefile->print("# $origin->{name}\n");
$zonefile->print("C\L$origin->{code}\E.${zone}:$cluster->{name}.${zone}:600\n");
- output_server($zonefile, "${default}.${zone}", $cluster);
+ output_server($zonefile, $jszonefile, "${default}.${zone}", "${default}.${jszone}", $cluster);
- output_server($zonefile, "${zone}", $cluster);
+ output_server($zonefile, $jszonefile, "${zone}", "${jszone}", $cluster);
- output_server($zonefile, "${name}.${zone}", $cluster);
+ output_server($zonefile, $jszonefile, "${name}.${zone}", "${name}.${jszone}", $cluster);
- output_server($zonefile, "${name}-%02d.${zone}", $cluster);
+ output_server($zonefile, $jszonefile, "${name}-%02d.${zone}", "${name}-%02d.${jszone}", $cluster);
{
my $number = sprintf("%02d", $index + 1);
my $bandwidth = $server->{bandwidth};
{
my $number = sprintf("%02d", $index + 1);
my $bandwidth = $server->{bandwidth};
if ($server->{status} eq "up")
{
$zonefile->printf("+${name}:$server->{ipv4}:600\n", $index + 1);
if ($server->{status} eq "up")
{
$zonefile->printf("+${name}:$server->{ipv4}:600\n", $index + 1);