source: trunk/gen-rDNS.pl@ 862

Last change on this file since 862 was 778, checked in by Kris Deugau, 9 years ago

/trunk

Build a quick hack to import the rDNS pattern table into rDNS.html from
the DNSAdmin source file instead of hand-copying it. Still committing
rDNS.html to SVN for convenience since it shouldn't change much.

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 2.4 KB
Line 
1#!/usr/bin/perl
2# Most of the file rDNS.html should be copied exactly from DNSAdmin. This
3# script creates rDNS.html from the source file in SVN at
4# https://secure.deepnet.cx/svn/dnsadmin/trunk/reverse-patterns.html
5
6use strict;
7use warnings;
8
9use LWP;
10
11my $ua = LWP::UserAgent->new;
12$ua->agent("ipdb-gen-rDNS");
13my $req = HTTP::Request->new(GET => "https://secure.deepnet.cx/svn/dnsadmin/trunk/reverse-patterns.html");
14my $res = $ua->request($req);
15die "Failed to retrieve source file from SVN: ".$res->status_line."\n" if !$res->is_success;
16
17my $srcfile = $res->content;
18
19open LRDNS, ">rDNS.html.new";
20print LRDNS << 'EOH'
21<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
22<html>
23<head>
24 <title>IP Database Reverse DNS Help</title>
25 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
26 <link rel="stylesheet" type="text/css" href="ipdb.css">
27 <link rel="stylesheet" type="text/css" href="local.css">
28</head>
29<body>
30
31<!--
32 This file is generated, and should not be edited directly. Edit gen-rDNS.pl to edit the header below, and
33 see https://secure.deepnet.cx/svn/dnsadmin/trunk/reverse-patterns.html for the tables.
34-->
35
36<p>The IP Database can pass reverse DNS information back and forth to a DNS management backend to simplify
37maintenance of the reverse DNS records associated with the IPs being managed.</p>
38
39<p>Several shortcuts can be used when specifying a pattern for an IPv4 netblock, which will be expanded to
40actual DNS records by the DNS management system.</p>
41
42<p>Entries should generally only be present in the "Per-IP reverse entries" section if they are different from
43the block pattern.</p>
44
45<p>Template patterns are not supported for IPv6 allocations due to the size of the address space and typical
46size of allocations.</p>
47
48<p>"(cached)" or "[local]" indicates the rDNS information shown came from IPDB records,
49and not the DNS management utility. It may be out of date, or DNS
50management integration may be missing or incomplete for this block.</p>
51
52EOH
53;
54
55my @l = split "\n", $srcfile;
56my $flag = 0;
57foreach my $line(@l) {
58 $flag = 1 if $line eq '<!-- rdns pattern table -->';
59 $flag = 0 if $line eq '<!-- done rdns pattern table -->';
60 next unless $flag;
61 print LRDNS "$line\n";
62}
63print LRDNS "<!-- done rdns pattern table -->\n\n</body>\n</html>\n";
64close LRDNS;
65
66# now that we have a supposedly good copy, move the .new to the canonical file.
67
68rename "rDNS.html.new", "rDNS.html";
Note: See TracBrowser for help on using the repository browser.