mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-06-03 21:52:07 -04:00
check Proxmox Backup Server API response for errors
This commit is contained in:
parent
020a4bb5b3
commit
bef0fdb1ae
1 changed files with 4 additions and 2 deletions
|
|
@ -116,13 +116,15 @@ HEREDOC
|
|||
export HTTPS_INSECURE=1
|
||||
export _H1="Authorization: PBSAPIToken=${_proxmoxbs_header_api_token}"
|
||||
response=$(_post "$_json_payload" "$_target_url" "" POST "application/json")
|
||||
response="$(echo "$response" | _json_decode | _normalizeJson)"
|
||||
message=$(echo "$response" | _egrep_o '"message":"[^"]*' | cut -d : -f 2 | tr -d '"')
|
||||
_retval=$?
|
||||
if [ "${_retval}" -eq 0 ]; then
|
||||
if [ "${_retval}" -eq 0 ] && [ -z "$message" ]; then
|
||||
_debug3 response "$response"
|
||||
_info "Certificate successfully deployed"
|
||||
return 0
|
||||
else
|
||||
_err "Certificate deployment failed"
|
||||
_err "Certificate deployment failed: $message"
|
||||
_debug "Response" "$response"
|
||||
return 1
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue