]> git.sesse.net Git - nms/blob - config/make-missing-zones.pl
Added Chillout.
[nms] / config / make-missing-zones.pl
1 #! /usr/bin/perl -w
2 use strict;
3
4 my $date = `date --rfc-2822`;
5 chomp $date;
6
7 my @nets = ();
8 open NAMES, "switches.txt"
9         or die "switches.txt: $!";
10 while (<NAMES>) {
11         chomp;
12         /87\.76\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
13         push @nets, {
14                 net => $1,
15                 netmask => $2,
16                 name => $3
17         };
18 }       
19
20 for my $net (@nets) {
21         my $d = $net->{name};
22
23         -f "/etc/bind/dynamic/$d.tg07.gathering.org" and next;
24                         
25         print "/etc/bind/dynamic/$d.tg07.gathering.org\n";
26         open ZONE, ">/etc/bind/dynamic/$d.tg07.gathering.org"
27                 or die "/etc/bind/dynamic/$d.tg07.gathering.org";
28
29         print ZONE <<"EOF";
30 ; autogenerated and updated from dhcpd -- DO NOT TOUCH!
31 \$TTL 3600
32 @       IN      SOA     sysrq.tg07.gathering.org.       abuse.gathering.org. (
33                         3   ; serial
34                         3600 ; refresh 
35                         1800 ; retry
36                         608400 ; expire
37                         3600 ) ; minimum and default TTL
38
39                 IN      NS      sysrq.tg07.gathering.org.
40                 IN      NS      insert.tg07.gathering.org.
41
42 EOF
43 }