source: genesis/dns/zone2rev.pl@ 3126

Last change on this file since 3126 was 3126, checked in by dirkx, 20 years ago

mooirere error msg

File size: 995 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-Resourcce 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-Resourcce 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 confict - 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.