Merge pull request #616 from retep/retep-patch-1-1
Update Mythic Beasts mythicdyn module in ddclient.in
This commit is contained in:
commit
fc4f87b33e
1 changed files with 31 additions and 23 deletions
54
ddclient.in
54
ddclient.in
|
@ -5876,12 +5876,13 @@ www.mythic-beasts.com.
|
||||||
|
|
||||||
Configuration variables applicable to the 'mythicdyn' protocol are:
|
Configuration variables applicable to the 'mythicdyn' protocol are:
|
||||||
protocol=mythicdyn ##
|
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
|
login=service-login ## the user name provided by the admin interface
|
||||||
password=service-password ## the password provided by the admin interface
|
password=service-password ## the password provided by the admin interface
|
||||||
fully.qualified.host ## the host registered with the service
|
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
|
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
|
request comes, so the IP address detected by ddclient is only used to keep
|
||||||
track of when it needs updating.
|
track of when it needs updating.
|
||||||
|
@ -5906,33 +5907,40 @@ EoEXAMPLE
|
||||||
sub nic_mythicdyn_update {
|
sub nic_mythicdyn_update {
|
||||||
debug("\nnic_mythicdyn_update --------------------");
|
debug("\nnic_mythicdyn_update --------------------");
|
||||||
|
|
||||||
# Update each set configured host.
|
# Update each configured host.
|
||||||
foreach my $h (@_) {
|
foreach my $h (@_) {
|
||||||
info("%s -- Setting IP address.", $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(
|
if (defined($ip)) {
|
||||||
proxy => opt('proxy'),
|
info("Process configuration for IPV%s --------", $mythver);
|
||||||
url => "https://ipv$ipversion.$config{$h}{'server'}/dns/v2/dynamic/$h",
|
my $reply = geturl(
|
||||||
method => 'POST',
|
proxy => opt('proxy'),
|
||||||
login => $config{$h}{'login'},
|
url => "https://ipv$mythver.$config{$h}{'server'}/dns/v2/dynamic/$h",
|
||||||
password => $config{$h}{'password'},
|
method => 'POST',
|
||||||
ipversion => $ipversion,
|
login => $config{$h}{'login'},
|
||||||
);
|
password => $config{$h}{'password'},
|
||||||
unless ($reply) {
|
ipversion => $mythver,
|
||||||
failed("Updating service %s failed: %s", $h, $config{$h}{'server'});
|
);
|
||||||
next;
|
unless ($reply) {
|
||||||
}
|
failed("Updating service %s failed: %s", $h, $config{$h}{'server'});
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
my $ok = header_ok($h, $reply);
|
my $ok = header_ok($h, $reply);
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
$config{$h}{'mtime'} = $now;
|
$config{$h}{'mtime'} = $now;
|
||||||
$config{$h}{'status'} = "good";
|
$config{$h}{"status-ipv$mythver"} = "good";
|
||||||
|
|
||||||
success("%s -- Updated successfully.", $h);
|
success("%s -- IPV%s Updated successfully.", $h, $mythver);
|
||||||
} else {
|
} else {
|
||||||
failed("%s -- Failed to update.", $h);
|
failed("%s -- Failed to update.", $h);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
info("No configuration for IPV%s -------------", $mythver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue