porkbun: Invert condition to improve readability
This commit is contained in:
parent
d8a23ff9a4
commit
536c7c87a2
1 changed files with 35 additions and 37 deletions
10
ddclient.in
10
ddclient.in
|
@ -6819,7 +6819,10 @@ sub nic_porkbun_update {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
my $records = $response->{records};
|
my $records = $response->{records};
|
||||||
if (ref($records) eq 'ARRAY' && defined $records->[0]->{'id'}) {
|
if (ref($records) ne 'ARRAY' || !defined($records->[0]{'id'})) {
|
||||||
|
failed("$h: no applicable existing records");
|
||||||
|
next;
|
||||||
|
}
|
||||||
warning("$h: There are multiple applicable records. Only first record is used. Overwrite all with the same content.")
|
warning("$h: There are multiple applicable records. Only first record is used. Overwrite all with the same content.")
|
||||||
if @$records > 1;
|
if @$records > 1;
|
||||||
if ($records->[0]{'content'} eq $ip) {
|
if ($records->[0]{'content'} eq $ip) {
|
||||||
|
@ -6854,11 +6857,6 @@ sub nic_porkbun_update {
|
||||||
}
|
}
|
||||||
$config{$h}{"status-ipv$ipv"} = "good";
|
$config{$h}{"status-ipv$ipv"} = "good";
|
||||||
success("$h: IPv%s address set to $ip");
|
success("$h: IPv%s address set to $ip");
|
||||||
next;
|
|
||||||
} else {
|
|
||||||
failed("$h: no applicable existing records");
|
|
||||||
next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue