From c60aa225a1d66f0d3eb6a36ad3d1b4c349a85a57 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 18 May 2024 00:34:35 -0400 Subject: [PATCH] godaddy: Rename `$status` to `$code` --- ddclient.in | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ddclient.in b/ddclient.in index 29bc1c0..2e0c65c 100755 --- a/ddclient.in +++ b/ddclient.in @@ -5790,12 +5790,12 @@ sub nic_godaddy_update { next; } - (my $status) = ($reply =~ m%^s*HTTP/.*\s+(\d+)%i); + (my $code) = ($reply =~ m%^s*HTTP/.*\s+(\d+)%i); my $ok = header_ok($host, $reply); my $msg; $reply =~ s/^.*?\n\n//s; # extract payload my $response = eval {decode_json($reply)}; - if (!defined($response) && $status != "200") { + if (!defined($response) && $code != "200") { $config{$host}{'status'} = "bad"; failed("%s.%s -- Unexpected or empty service response, cannot parse data.", $hostname, $zone); @@ -5808,26 +5808,26 @@ sub nic_godaddy_update { $config{$host}{'mtime'} = $now; $config{$host}{"status-ipv$ipversion"} = 'good'; - success("%s.%s -- Updated successfully to %s (status: %s).", $hostname, $zone, $ip, $status); + success("%s.%s -- Updated successfully to %s (status: %s).", $hostname, $zone, $ip, $code); next; - } elsif ($status == "400") { + } elsif ($code == "400") { $msg = 'GoDaddy API URL ($url) was malformed.'; - } elsif ($status == "401") { # authentication error + } elsif ($code == "401") { # authentication error if ($config{$host}{'login'} && $config{$host}{'login'}) { $msg = 'login or password option incorrect.'; } else { $msg = 'login or password option missing.'; } $msg .= ' Correct values can be obtained from from https://developer.godaddy.com/keys/.'; - } elsif ($status == "403") { + } elsif ($code == "403") { $msg = 'Customer identified by login and password options denied permission.'; - } elsif ($status == "404") { + } elsif ($code == "404") { $msg = "\"${hostname}.${zone}\" not found at GoDaddy, please check zone option and login/password."; - } elsif ($status == "422") { + } elsif ($code == "422") { $msg = "\"${hostname}.${zone}\" has invalid domain or lacks A/AAAA record."; - } elsif ($status == "429") { + } elsif ($code == "429") { $msg = 'Too many requests to GoDaddy within brief period.'; - } elsif ($status == "503") { + } elsif ($code == "503") { $msg = "\"${hostname}.${zone}\" is unavailable."; } else { $msg = 'Unexpected service response.';