added new is-managed for testing

This commit is contained in:
2016-02-24 09:47:16 -05:00
parent 80061a8829
commit c72968f277
3 changed files with 28 additions and 6 deletions

21
bin/is-managed Executable file
View 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";