diff --git a/ChangeLog.md b/ChangeLog.md index c54c01f..6043520 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -84,6 +84,8 @@ repository history](https://github.com/ddclient/ddclient/commits/master). records. [#695](https://github.com/ddclient/ddclient/pull/695) * `inwx`: New `protocol` option for updating [INWX](https://www.inwx.com/) records. [#690](https://github.com/ddclient/ddclient/pull/690) + * `domeneshop`: Add IPv6 support. + [#719](https://github.com/ddclient/ddclient/pull/719) ### Bug fixes diff --git a/ddclient.in b/ddclient.in index 0f2bf81..3228b5d 100755 --- a/ddclient.in +++ b/ddclient.in @@ -4314,23 +4314,25 @@ EoEXAMPLE sub nic_domeneshop_update { debug("\nnic_domeneshop_update -------------------"); for my $h (@_) { - my $ip = delete $config{$h}{'wantip'}; - info("$h: Setting IP address to $ip"); - my $reply = geturl( - proxy => opt('proxy'), - url => "$config{$h}{'server'}/v0/dyndns/update?hostname=$h&myip=$ip", - login => $config{$h}{'login'}, - password => $config{$h}{'password'}, - ); - if (!defined($reply) || !$reply) { - failed("$h: Request to $config{$h}{'server'} failed"); - next; + for my $ipv ('4', '6') { + my $ip = delete $config{$h}{"wantipv$ipv"} or next; + info("$h: Setting IPv$ipv address to $ip"); + my $reply = geturl( + proxy => opt('proxy'), + url => "$config{$h}{'server'}/v0/dyndns/update?hostname=$h&myip=$ip", + login => $config{$h}{'login'}, + password => $config{$h}{'password'}, + ); + if (!defined($reply) || !$reply) { + failed("$h: Request to $config{$h}{'server'} failed"); + next; + } + next if !header_ok($h, $reply); + $config{$h}{"ipv$ipv"} = $ip; + $config{$h}{'mtime'} = $now; + $config{$h}{"status-ipv$ipv"} = 'good'; + success("$h: IPv$ipv address set to $ip"); } - next if !header_ok($h, $reply); - $config{$h}{'ip'} = $ip; - $config{$h}{'mtime'} = $now; - $config{$h}{'status'} = 'good'; - success("$h: IP address set to $ip"); } }