easydns: Invert condition to improve readability

This commit is contained in:
Richard Hansen 2024-07-19 19:39:00 -04:00
parent da26fe76e0
commit 435357ac50

View file

@ -4823,15 +4823,17 @@ sub nic_easydns_update {
}; };
my ($status) = $body =~ qr/^(\S*)\b/; my ($status) = $body =~ qr/^(\S*)\b/;
$config{$h}{"status-ipv$ipv"} = $status; $config{$h}{"status-ipv$ipv"} = $status;
if ($status eq 'NOERROR') { if ($status ne 'NOERROR') {
$config{$h}{"ipv$ipv"} = $ip; if (exists $errors{$status}) {
$config{$h}{'mtime'} = $now;
success("$h: IPv$ipv address set to $ip");
} elsif (exists $errors{$status}) {
failed("$h: $status: $errors{$status}"); failed("$h: $status: $errors{$status}");
} else { } else {
failed("$h: unexpected result: $body"); failed("$h: unexpected result: $body");
} }
next;
}
$config{$h}{"ipv$ipv"} = $ip;
$config{$h}{'mtime'} = $now;
success("$h: IPv$ipv address set to $ip");
} }
} }
} }