]> git.sesse.net Git - nms/commitdiff
Add make-missing-zones.pl from TG05, adjusting for TG06.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sun, 9 Apr 2006 19:42:04 +0000 (19:42 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sun, 9 Apr 2006 19:42:04 +0000 (19:42 +0000)
config/make-missing-zones.pl [new file with mode: 0755]

diff --git a/config/make-missing-zones.pl b/config/make-missing-zones.pl
new file mode 100755 (executable)
index 0000000..060a0c4
--- /dev/null
@@ -0,0 +1,46 @@
+#! /usr/bin/perl -w
+use strict;
+
+# les inn nettnavn
+my %netnames = ();
+open NAMES, "switches.txt"
+       or die "switches.txt: $!";
+while (<NAMES>) {
+       chomp;
+       /194\.0\.(\d+\.\d+)\s+(\S+)\s+(\S+)/ or next;
+       $netnames{$1} = $3;
+}
+close NAMES;
+
+for my $net (keys %netnames) {
+       my $domain = $netnames{$net};
+       my @domains;
+       if ($domain =~ /^split:(.*)/) {
+               @domains = split /,/, $1;
+       } else {
+               @domains = ($domain);
+       }
+
+       for my $d (@domains) {
+               -f "/etc/bind/dynamic/$domain.tg06.gathering.org" and next;
+                       
+               print "/etc/bind/dynamic/$domain.tg06.gathering.org\n";
+               open ZONE, ">/etc/bind/dynamic/$domain.tg06.gathering.org"
+                       or die "/etc/bind/dynamic/$domain.tg06.gathering.org";
+
+               print ZONE <<"EOF";
+; autogenerated and updated from dhcpd -- DO NOT TOUCH!
+\$TTL 3600
+@      IN      SOA     fortran.tg06.gathering.org.     postmaster.fortran.tg06.gathering.org. (
+                       3   ; serial
+                       3600 ; refresh 
+                       1800 ; retry
+                       608400 ; expire
+                       3600 ) ; minimum and default TTL
+
+               IN      NS      fortran.tg06.gathering.org.
+               IN      NS      lisp.tg06.gathering.org.
+
+EOF
+       }
+}