Merge pull request #616 from retep/retep-patch-1-1

Update Mythic Beasts mythicdyn module in ddclient.in
This commit is contained in:
Lenard Hess 2024-01-14 14:09:47 +01:00 committed by GitHub
commit fc4f87b33e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5876,12 +5876,13 @@ www.mythic-beasts.com.
Configuration variables applicable to the 'mythicdyn' protocol are:
protocol=mythicdyn ##
ipv6=no|yes ## whether to set an A record (default, ipv6=no)
## or AAAA record (ipv6=yes).
login=service-login ## the user name provided by the admin interface
password=service-password ## the password provided by the admin interface
fully.qualified.host ## the host registered with the service
Note: this module examines the wantipv4 & wantipv6 parameters
and will set either or both V4 and/or V6 addresses as required
Note: this service automatically sets the IP address to that from which the
request comes, so the IP address detected by ddclient is only used to keep
track of when it needs updating.
@ -5906,33 +5907,40 @@ EoEXAMPLE
sub nic_mythicdyn_update {
debug("\nnic_mythicdyn_update --------------------");
# Update each set configured host.
# Update each configured host.
foreach my $h (@_) {
info("%s -- Setting IP address.", $h);
my $ipversion = $config{$h}{'ipv6'} ? '6' : '4';
foreach my $mythver ('4','6') {
my $ip = $config{$h}{"wantipv$mythver"};
my $reply = geturl(
proxy => opt('proxy'),
url => "https://ipv$ipversion.$config{$h}{'server'}/dns/v2/dynamic/$h",
method => 'POST',
login => $config{$h}{'login'},
password => $config{$h}{'password'},
ipversion => $ipversion,
);
unless ($reply) {
failed("Updating service %s failed: %s", $h, $config{$h}{'server'});
next;
}
if (defined($ip)) {
info("Process configuration for IPV%s --------", $mythver);
my $reply = geturl(
proxy => opt('proxy'),
url => "https://ipv$mythver.$config{$h}{'server'}/dns/v2/dynamic/$h",
method => 'POST',
login => $config{$h}{'login'},
password => $config{$h}{'password'},
ipversion => $mythver,
);
unless ($reply) {
failed("Updating service %s failed: %s", $h, $config{$h}{'server'});
next;
}
my $ok = header_ok($h, $reply);
if ($ok) {
$config{$h}{'mtime'} = $now;
$config{$h}{'status'} = "good";
my $ok = header_ok($h, $reply);
if ($ok) {
$config{$h}{'mtime'} = $now;
$config{$h}{"status-ipv$mythver"} = "good";
success("%s -- Updated successfully.", $h);
} else {
failed("%s -- Failed to update.", $h);
success("%s -- IPV%s Updated successfully.", $h, $mythver);
} else {
failed("%s -- Failed to update.", $h);
}
} else {
info("No configuration for IPV%s -------------", $mythver);
}
}
}
}