diff --git a/ddclient.in b/ddclient.in index b8f8f34..a8ec647 100755 --- a/ddclient.in +++ b/ddclient.in @@ -7990,7 +7990,6 @@ EoEXAMPLE sub nic_infomaniak_update { debug("\nnic_infomaniak_update -------------------"); for my $h (@_) { - INFOMANIAK_IP_LOOP: for my $v (4, 6) { my $ip = delete $config{$h}{"wantipv$v"}; if (!defined $ip) { @@ -8010,37 +8009,28 @@ sub nic_infomaniak_update { 'nohost' => (0, sprintf("Bad domain name %s or bad IP %s", $h, $ip)), 'badauth' => (0, sprintf("Bad authentication for %s", $h)), ); - my $url1 = "https://$config{$h}{'login'}:$config{$h}{'password'}"; - $url1 .= "\@infomaniak.com/nic/update"; - $url1 .= "?hostname=$h"; - $url1 .= "&myip=$ip"; - my $url2 = "https://infomaniak.com/nic/update"; - $url2 .= "?hostname=$h"; - $url2 .= "&myip=$ip"; - $url2 .= "&username=$config{$h}{'login'}"; - $url2 .= "&password=$config{$h}{'password'}"; - for my $url ($url1, $url2) { - info("trying update with %s", $url); - my $reply = geturl(proxy => opt('proxy'), url => $url); - if (!$reply) { - info("could not update %s using url %s, trying next one", $h, $url); - next; - } - my ($status) = split / /, $reply, 1; - my ($updated, $msg) = - $statuses{$status} // (0, sprintf("Unknown reply from Infomaniak: %s", $reply)); - if ($updated) { - info($msg); - $config{$h}{"ipv$v"} = $ip; - $config{$h}{'mtime'} = $now; - $config{$h}{"status-ipv$v"} = 'good'; - next INFOMANIAK_IP_LOOP; - } else { - warning($msg); - } + my $reply = geturl( + proxy => opt('proxy'), + url => "https://infomaniak.com/nic/update?hostname=$h&myip=$ip", + login => $config{$h}{'login'}, + password => $config{$h}{'password'}, + ); + if (!$reply) { + failed("could not update %s", $h); + next; + } + my ($status) = split / /, $reply, 1; + my ($updated, $msg) = + $statuses{$status} // (0, sprintf("Unknown reply from Infomaniak: %s", $reply)); + if ($updated) { + success($msg); + $config{$h}{"ipv$v"} = $ip; + $config{$h}{'mtime'} = $now; + $config{$h}{"status-ipv$v"} = 'good'; + next; + } else { + failed($msg); } - $config{$h}{"status-ipv$v"} = 'failed'; - failed("updating %s: could not update IP on Infomaniak", $h); } } }