added new is-managed for testing
This commit is contained in:
21
bin/is-managed
Executable file
21
bin/is-managed
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Martnet::DDNS;
|
||||
|
||||
my $dom = shift || die;
|
||||
|
||||
$dom =~ s/^(.+)\.$/$1/; # remove trailing dot
|
||||
|
||||
my $ddns = Martnet::DDNS->new();
|
||||
|
||||
my @vh = $ddns->get();
|
||||
foreach my $i (@vh) {
|
||||
if (lc($i->{zone}) eq $dom) {
|
||||
print "Yes, $i->{zone} is managed [$i->{type}]\n";
|
||||
exit 0;
|
||||
}
|
||||
}
|
||||
|
||||
print "No, $dom does not appear to be managed\n";
|
||||
@ -63,7 +63,7 @@ sub create_zonefile {
|
||||
|
||||
my $zone = $i->{zone} . ".";
|
||||
my @now = localtime();
|
||||
my $serial = sprintf("%.4d%.2d%.2d00", $now[5]+1900, $now[4]+1, $now[3]);
|
||||
my $serial = sprintf("%.4d%.2d%.2d01", $now[5]+1900, $now[4]+1, $now[3]);
|
||||
|
||||
print $fh <<EOF
|
||||
;
|
||||
@ -82,11 +82,11 @@ $zone IN SOA ns.martnet.com. root.ns.martnet.com. (
|
||||
43200 ) ; Negative Cache TTL 12 hours
|
||||
|
||||
; define name servers
|
||||
$zone IN NS ns.martnet.com
|
||||
$zone IN NS ns1.martnet.com
|
||||
$zone IN NS ns2.martnet.com
|
||||
$zone IN NS ns3.martnet.com
|
||||
$zone IN NS ns4.martnet.com
|
||||
$zone IN NS ns.martnet.com.
|
||||
$zone IN NS ns1.martnet.com.
|
||||
$zone IN NS ns2.martnet.com.
|
||||
$zone IN NS ns3.martnet.com.
|
||||
$zone IN NS ns4.martnet.com.
|
||||
|
||||
; define localhost
|
||||
localhost IN A 127.0.0.1
|
||||
|
||||
Reference in New Issue
Block a user