add foreign registry; remove slave setups

This commit is contained in:
2026-02-01 15:16:52 -05:00
parent 5a432a75a8
commit d67cea92cb
6 changed files with 39 additions and 77 deletions

31
bin/add-foreign Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/perl
use strict;
use warnings;
use Martnet::DDNS;
use Regexp::Common qw/net/;
use Getopt::Long qw/GetOptions/;
use JSON::PP qw/encode_json true false/;
sub usage {
die "Usage: add-foreign <zone.>\n";
}
my $host = shift || die "No zonename provided\n";
my $ddns = Martnet::DDNS->new();
die "Zonename must end in a dot\n"
unless ($host =~ /^[a-zA-Z0-9\.\-\_]+\.$/);
my $payload = { };
my $txt = encode_json($payload);
if ($edit) {
$ddns->set($host, $txt, '_foreign');
} else {
$ddns->add($host, $txt, '_foreign');
}
exit 0;