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!
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
- }
}