source: genesis/dns/zone2rev.pl@ 3135

Last change on this file since 3135 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
RevLine 
[3124]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
[3134]23 warn "A-Resource defined in two places\n\tfor $ip/$host at line $. and $line{$ip}\n"
[3124]24 if defined $host{$ip} and $host{$ip} eq $host;
25
[3134]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"
[3124]27 if defined $host{$ip};
28
[3126]29 warn "Resource defined in two places\n\t$host at $ip{$host} at line $. and $line{$host}.\n"
[3124]30 if defined $ip{$host} and $ip eq $ip{$host};
31
[3134]32 warn "Resource conflict - there should be just one.\n\t$host at $ip{$host} and $ip at line $. and $line{$host}\n"
[3124]33 if defined $ip{$host};
34
35 $host{$ip} = $host;
36 $ip{$host} = $ip;
[3126]37 $line{$ip} = $line{$host} = $.;
[3124]38
39 print "$ip\t$host\n";
40};
41
Note: See TracBrowser for help on using the repository browser.