diff --git a/ddclient.in b/ddclient.in index 5daaa3a..d32ede2 100755 --- a/ddclient.in +++ b/ddclient.in @@ -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); + } } } }