source: genesis/dns/zone2rev.pl@ 3415

Last change on this file since 3415 was 3134, checked in by lodewijk, 20 years ago

de makkelijke warnings van zone2rev.pl eruit. wat over blijft zijn de vele
aliases voor de blade en mammy op unigor die dual-homed is, plus wat gedoe
over fallback1.wleiden.net

File size: 994 bytes
Line 
1#!/usr/bin/perl
2#
3open STDIN,shift @ARGV
4 or die "Cannot open $_:$!"
5 if @ARGV;
6
7$domain = '.';
8
9while(<STDIN>) {
10
11 if (m/\$ORIGIN\s+([\w\-\.]+)/) {
12 $domain = lc $1;
13 next;
14 };
15 next
16 unless m/^\s*([\w\-\.]+)\s+(IN\s+)?A\s+([\d\.]+)/i;
17
18 my ($host,$ip) = (lc $1,lc $3);
19
20 $host .= '.'.$domain
21 unless $host =~ m/\.$/;
22
23 warn "A-Resource defined in two places\n\tfor $ip/$host at line $. and $line{$ip}\n"
24 if defined $host{$ip} and $host{$ip} eq $host;
25
26 warn "A-Resource Conflict - there should be just one.\n\t$ip used for $host and $host{$ip} at line $. and $line{$ip}\n"
27 if defined $host{$ip};
28
29 warn "Resource defined in two places\n\t$host at $ip{$host} at line $. and $line{$host}.\n"
30 if defined $ip{$host} and $ip eq $ip{$host};
31
32 warn "Resource conflict - there should be just one.\n\t$host at $ip{$host} and $ip at line $. and $line{$host}\n"
33 if defined $ip{$host};
34
35 $host{$ip} = $host;
36 $ip{$host} = $ip;
37 $line{$ip} = $line{$host} = $.;
38
39 print "$ip\t$host\n";
40};
41
Note: See TracBrowser for help on using the repository browser.