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";
|
||||
Reference in New Issue
Block a user