]> git.openstreetmap.org Git - dns.git/blobdiff - bin/mkgeo
Fix name of generated JSON files
[dns.git] / bin / mkgeo
index 400fff7cdc4dc24cde40c076f42086e2952fd8e7..9cfb6c124c6b9e421935af4126136df7c17426d5 100755 (executable)
--- a/bin/mkgeo
+++ b/bin/mkgeo
@@ -205,7 +205,7 @@ my @json;
 
 # Open output files
 my $zonefile = IO::File->new("> include/${zone}.js") || die "$!";
-my $jsonfile = IO::File->new("> json/${zone}.json") || die "$!";
+my $jsonfile = IO::File->new("> json/${zone}.openstreetmap.org.json") || die "$!";
 
 # Output headers
 $zonefile->print("var \U${zone}\E_RECORDS = [\n");
@@ -348,7 +348,7 @@ if (defined($gdnsname))
                     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}.openstreetmap.org., ${bandwidth} ]\n");
                 }
             }
 
@@ -358,7 +358,7 @@ if (defined($gdnsname))
         }
         else
         {
-            $gdnsresourcefile->print("    ${name} => ${name}.${zone}.\n");
+            $gdnsresourcefile->print("    ${name} => ${name}.${zone}.openstreetmap.org.\n");
         }
     }
 
@@ -534,11 +534,7 @@ sub output_server
 
             if ($server->{ipv6})
             {
-                my $ipv6 = $server->{ipv6};
-
-                $ipv6 =~ s/([0-9a-f]{4})(?=.)/$1:/ig;
-
-                $zonefile->printf("  AAAA(\"${name}\", \"${ipv6}\", TTL(\"10m\")),\n", $index + 1);
+                $zonefile->printf("  AAAA(\"${name}\", \"$server->{ipv6}\", TTL(\"10m\")),\n", $index + 1);
             }
         }
     }