infomaniak: Delete unnecessary newlines
This commit is contained in:
parent
e0d9bcc36d
commit
134e47b61d
1 changed files with 1 additions and 13 deletions
14
ddclient.in
14
ddclient.in
|
@ -7989,19 +7989,15 @@ EoEXAMPLE
|
||||||
######################################################################
|
######################################################################
|
||||||
sub nic_infomaniak_update {
|
sub nic_infomaniak_update {
|
||||||
debug("\nnic_infomaniak_update -------------------");
|
debug("\nnic_infomaniak_update -------------------");
|
||||||
|
|
||||||
for my $h (@_) {
|
for my $h (@_) {
|
||||||
INFOMANIAK_IP_LOOP:
|
INFOMANIAK_IP_LOOP:
|
||||||
for my $v (4, 6) {
|
for my $v (4, 6) {
|
||||||
my $ip = delete $config{$h}{"wantipv$v"};
|
my $ip = delete $config{$h}{"wantipv$v"};
|
||||||
|
|
||||||
if (!defined $ip) {
|
if (!defined $ip) {
|
||||||
debug("ipv%d not wanted, skipping", $v);
|
debug("ipv%d not wanted, skipping", $v);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
info("setting IP address to %s for %s", $ip, $h);
|
info("setting IP address to %s for %s", $ip, $h);
|
||||||
|
|
||||||
# No change in IP => nochg <w.x.y.z>
|
# No change in IP => nochg <w.x.y.z>
|
||||||
# Bad auth => badauth
|
# Bad auth => badauth
|
||||||
# Bad domain name => nohost
|
# Bad domain name => nohost
|
||||||
|
@ -8014,20 +8010,16 @@ sub nic_infomaniak_update {
|
||||||
'nohost' => (0, sprintf("Bad domain name %s or bad IP %s", $h, $ip)),
|
'nohost' => (0, sprintf("Bad domain name %s or bad IP %s", $h, $ip)),
|
||||||
'badauth' => (0, sprintf("Bad authentication for %s", $h)),
|
'badauth' => (0, sprintf("Bad authentication for %s", $h)),
|
||||||
);
|
);
|
||||||
|
|
||||||
my $url1 = "https://$config{$h}{'login'}:$config{$h}{'password'}";
|
my $url1 = "https://$config{$h}{'login'}:$config{$h}{'password'}";
|
||||||
$url1 .= "\@infomaniak.com/nic/update";
|
$url1 .= "\@infomaniak.com/nic/update";
|
||||||
$url1 .= "?hostname=$h";
|
$url1 .= "?hostname=$h";
|
||||||
$url1 .= "&myip=$ip";
|
$url1 .= "&myip=$ip";
|
||||||
|
|
||||||
my $url2 = "https://infomaniak.com/nic/update";
|
my $url2 = "https://infomaniak.com/nic/update";
|
||||||
$url2 .= "?hostname=$h";
|
$url2 .= "?hostname=$h";
|
||||||
$url2 .= "&myip=$ip";
|
$url2 .= "&myip=$ip";
|
||||||
$url2 .= "&username=$config{$h}{'login'}";
|
$url2 .= "&username=$config{$h}{'login'}";
|
||||||
$url2 .= "&password=$config{$h}{'password'}";
|
$url2 .= "&password=$config{$h}{'password'}";
|
||||||
|
|
||||||
my $reply;
|
my $reply;
|
||||||
|
|
||||||
for my $url ($url1, $url2) {
|
for my $url ($url1, $url2) {
|
||||||
info("trying update with %s", $url);
|
info("trying update with %s", $url);
|
||||||
$reply = geturl(proxy => opt('proxy'), url => $url);
|
$reply = geturl(proxy => opt('proxy'), url => $url);
|
||||||
|
@ -8035,23 +8027,19 @@ sub nic_infomaniak_update {
|
||||||
info("could not update %s using url %s, trying next one", $h, $url);
|
info("could not update %s using url %s, trying next one", $h, $url);
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
my ($status) = split / /, $reply, 1;
|
my ($status) = split / /, $reply, 1;
|
||||||
my ($updated, $msg) =
|
my ($updated, $msg) =
|
||||||
$statuses{$status} // (0, sprintf("Unknown reply from Infomaniak: %s", $reply));
|
$statuses{$status} // (0, sprintf("Unknown reply from Infomaniak: %s", $reply));
|
||||||
|
|
||||||
if (defined $updated && $updated) {
|
if (defined $updated && $updated) {
|
||||||
info($msg);
|
info($msg);
|
||||||
$config{$h}{"ipv$v"} = $ip;
|
$config{$h}{"ipv$v"} = $ip;
|
||||||
$config{$h}{'mtime'} = $now;
|
$config{$h}{'mtime'} = $now;
|
||||||
$config{$h}{"status-ipv$v"} = 'good';
|
$config{$h}{"status-ipv$v"} = 'good';
|
||||||
next INFOMANIAK_IP_LOOP;
|
next INFOMANIAK_IP_LOOP;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
warning($msg);
|
warning($msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$config{$h}{"status-ipv$v"} = 'failed';
|
$config{$h}{"status-ipv$v"} = 'failed';
|
||||||
failed("updating %s: could not update IP on Infomaniak", $h);
|
failed("updating %s: could not update IP on Infomaniak", $h);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue