From 56f4a2afe22b7ad9837c4033fdb3288a5165ad7d Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 7 Jun 2024 01:00:21 -0400 Subject: [PATCH] godaddy: Don't bother setting status on error It's initialized to a non-'good' value before the function is called, and ddclient doesn't distinguish between different non-good values, so it is sufficient to leave it alone. --- ddclient.in | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ddclient.in b/ddclient.in index be3231c..4ad1361 100755 --- a/ddclient.in +++ b/ddclient.in @@ -5746,7 +5746,6 @@ sub nic_godaddy_update { next if (!$ip); my $ipversion = ($ip eq ($ipv6 // '')) ? '6' : '4'; info("$host: Setting IPv$ipversion address to $ip"); - my $status = \$config{$host}{"status-ipv$ipversion"}; my $rrset_type = ($ipversion eq '6') ? 'AAAA' : 'A'; my $data = encode_json([{ data => $ip, @@ -5776,7 +5775,6 @@ sub nic_godaddy_update { $reply =~ s/^.*?\n\n//s; my $response = eval {decode_json($reply)}; if (!defined($response)) { - $$status = "bad"; failed("$host: Unexpected or empty service response, cannot parse data"); next; } elsif (defined($response->{code})) { @@ -5785,7 +5783,7 @@ sub nic_godaddy_update { if ($ok) { $config{$host}{"ipv$ipversion"} = $ip; $config{$host}{'mtime'} = $now; - $$status = 'good'; + $config{$host}{"status-ipv$ipversion"} = 'good'; success("$host: Updated successfully to $ip (status: $code)"); next; } elsif ($code == "400") { @@ -5810,7 +5808,6 @@ sub nic_godaddy_update { } else { $msg = 'Unexpected service response.'; } - $$status = 'bad'; failed("$host: $msg"); } }