]> git.sesse.net Git - nms/commitdiff
Remove the split stuff from make-named.pl.
authorroot <root@sysrq>
Sat, 31 Mar 2007 20:23:01 +0000 (22:23 +0200)
committerroot <root@sysrq>
Sat, 31 Mar 2007 20:23:01 +0000 (22:23 +0200)
config/make-named.pl

index 5f999ab44cf523174841e87236ec1c358ec8fa82..94b8959f67b2cd8918777bb3d6ea4ed13dd10f4a 100755 (executable)
@@ -4,19 +4,18 @@ use strict;
 my $date = `date --rfc-2822`;
 chomp $date;
 
-# les inn nettnavn
-my %netnames = ();
-my %netmasks = ();
 my @nets = ();
 open NAMES, "switches.txt"
-or die "switches.txt: $!";
+       or die "switches.txt: $!";
 while (<NAMES>) {
        chomp;
-       /194\.0\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
-       $netmasks{$1} = $2;
-       $netnames{$1} = $3;
-       push @nets, $1;
-}
+       /87\.76\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
+       push @nets, {
+               net => $1,
+               netmask => $2,
+               name => $3
+       };
+}      
 
 print <<"EOF";
 // Autogenerated by make-named.pl at $date. Do not edit manually! 
@@ -71,23 +70,14 @@ key DHCP_UPDATER {
 EOF
 
 for my $net (@nets) {
-       my $domain = $netnames{$net};
-       my @domains;
-       if ($domain =~ /^split:(.*)/) {
-               @domains = split /,/, $1;
-       } else {
-               @domains = ($domain);
-       }
-
-       for my $d (@domains) {
-               print <<"EOF";
-zone "$d.tg07.gathering.org" {
+       my $domain = $net->{name};
+       print <<"EOF";
+zone "$domain.tg07.gathering.org" {
        type master;
        allow-update { key DHCP_UPDATER; };
        notify yes;
-       file "dynamic/$d.tg07.gathering.org";
+       file "dynamic/$domain.tg07.gathering.org";
        allow-transfer { 194.19.3.20; 194.0.255.2; };
 };
 EOF
-       }
 }