added custom types
This commit is contained in:
19
bin/add-custom
Executable file
19
bin/add-custom
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Martnet::DDNS;
|
||||
use Regexp::Common qw/net/;
|
||||
|
||||
my $host = shift || die "No zonename provided";
|
||||
my $master = shift || die "No master DNS IP provided";
|
||||
|
||||
die "Zonename must end in a dot"
|
||||
unless ($host =~ /^[a-zA-Z0-9\.\-\_]+\.$/);
|
||||
|
||||
my $regex = $RE{net}{IPv4} . '|' . $RE{net}{IPv6};
|
||||
die "Master must be an IPv4 or IPv6 address"
|
||||
unless ($master =~ /^$regex$/);
|
||||
|
||||
my $ddns = Martnet::DDNS->new();
|
||||
$ddns->add($host, $master, '_custom');
|
||||
14
bin/del-custom
Executable file
14
bin/del-custom
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Martnet::DDNS;
|
||||
use Regexp::Common qw/net/;
|
||||
|
||||
my $host = shift || die "No zonename provided";
|
||||
|
||||
die "Zonename must end in a dot"
|
||||
unless ($host =~ /^[a-zA-Z0-9\-\_\.]+\.$/);
|
||||
|
||||
my $ddns = Martnet::DDNS->new();
|
||||
$ddns->del($host, '_custom');
|
||||
12
bin/list-custom
Executable file
12
bin/list-custom
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Martnet::DDNS;
|
||||
|
||||
my $ddns = Martnet::DDNS->new();
|
||||
|
||||
my @vh = $ddns->get('_custom');
|
||||
foreach my $i (sort {$a->{zone} cmp $b->{zone}} @vh) {
|
||||
print $i->{zone}, ". master: ", $i->{master},"\n";
|
||||
}
|
||||
Reference in New Issue
Block a user