Update arubacentral.sh

This commit is contained in:
Gondolf 2025-02-14 12:54:17 +01:00 committed by GitHub
parent 980a250956
commit 4a58ddd0aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -170,8 +170,10 @@ _delete_old_certificate() {
response=$(_post "" "$delete_url" "" "DELETE" "application/json")
_debug "Delete certificate API response: $response"
if echo "$response" | grep -q '"error"'; then
_err "❌ Failed to delete previous certificate."
if echo "$response" | jq -e '.description | test("not present")' >/dev/null 2>&1; then
_debug "✅ Previous certificate not found - skipping."
elif echo "$response" | jq -e '.error_code' >/dev/null 2>&1; then
_err "❌ Failed to delete previous certificate: $(echo "$response" | jq -r '.description')"
else
_debug "✅ Previous certificate deleted successfully."
fi