mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-25 14:41:40 +00:00
Merge branch 'acmesh-official:dev' into dev
This commit is contained in:
commit
cd6698c688
27
acme.sh
27
acme.sh
@ -4712,26 +4712,13 @@ $_authorizations_map"
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_debug "sleep 2 secs to verify"
|
|
||||||
sleep 2
|
|
||||||
_debug "checking"
|
|
||||||
|
|
||||||
_send_signed_request "$uri"
|
|
||||||
|
|
||||||
if [ "$?" != "0" ]; then
|
|
||||||
_err "$d:Verify error:$response"
|
|
||||||
_clearupwebbroot "$_currentRoot" "$removelevel" "$token"
|
|
||||||
_clearup
|
|
||||||
_on_issue_err "$_post_hook" "$vlist"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
_debug2 original "$response"
|
_debug2 original "$response"
|
||||||
|
|
||||||
response="$(echo "$response" | _normalizeJson)"
|
response="$(echo "$response" | _normalizeJson)"
|
||||||
_debug2 response "$response"
|
_debug2 response "$response"
|
||||||
|
|
||||||
status=$(echo "$response" | _egrep_o '"status":"[^"]*' | cut -d : -f 2 | tr -d '"')
|
status=$(echo "$response" | _egrep_o '"status":"[^"]*' | cut -d : -f 2 | tr -d '"')
|
||||||
|
_debug2 status "$status"
|
||||||
if _contains "$status" "invalid"; then
|
if _contains "$status" "invalid"; then
|
||||||
error="$(echo "$response" | _egrep_o '"error":\{[^\}]*')"
|
error="$(echo "$response" | _egrep_o '"error":\{[^\}]*')"
|
||||||
_debug2 error "$error"
|
_debug2 error "$error"
|
||||||
@ -4773,7 +4760,19 @@ $_authorizations_map"
|
|||||||
_on_issue_err "$_post_hook" "$vlist"
|
_on_issue_err "$_post_hook" "$vlist"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
_debug "sleep 2 secs to verify again"
|
||||||
|
sleep 2
|
||||||
|
_debug "checking"
|
||||||
|
|
||||||
|
_send_signed_request "$uri"
|
||||||
|
|
||||||
|
if [ "$?" != "0" ]; then
|
||||||
|
_err "$d:Verify error:$response"
|
||||||
|
_clearupwebbroot "$_currentRoot" "$removelevel" "$token"
|
||||||
|
_clearup
|
||||||
|
_on_issue_err "$_post_hook" "$vlist"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
done
|
done
|
||||||
|
@ -37,11 +37,19 @@ sendgrid_send() {
|
|||||||
fi
|
fi
|
||||||
_saveaccountconf_mutable SENDGRID_FROM "$SENDGRID_FROM"
|
_saveaccountconf_mutable SENDGRID_FROM "$SENDGRID_FROM"
|
||||||
|
|
||||||
|
SENDGRID_FROM_NAME="${SENDGRID_FROM_NAME:-$(_readaccountconf_mutable SENDGRID_FROM_NAME)}"
|
||||||
|
_saveaccountconf_mutable SENDGRID_FROM_NAME "$SENDGRID_FROM_NAME"
|
||||||
|
|
||||||
export _H1="Authorization: Bearer $SENDGRID_API_KEY"
|
export _H1="Authorization: Bearer $SENDGRID_API_KEY"
|
||||||
export _H2="Content-Type: application/json"
|
export _H2="Content-Type: application/json"
|
||||||
|
|
||||||
_content="$(echo "$_content" | _json_encode)"
|
_content="$(echo "$_content" | _json_encode)"
|
||||||
_data="{\"personalizations\": [{\"to\": [{\"email\": \"$SENDGRID_TO\"}]}],\"from\": {\"email\": \"$SENDGRID_FROM\"},\"subject\": \"$_subject\",\"content\": [{\"type\": \"text/plain\", \"value\": \"$_content\"}]}"
|
|
||||||
|
if [ -z "$SENDGRID_FROM_NAME" ]; then
|
||||||
|
_data="{\"personalizations\": [{\"to\": [{\"email\": \"$SENDGRID_TO\"}]}],\"from\": {\"email\": \"$SENDGRID_FROM\"},\"subject\": \"$_subject\",\"content\": [{\"type\": \"text/plain\", \"value\": \"$_content\"}]}"
|
||||||
|
else
|
||||||
|
_data="{\"personalizations\": [{\"to\": [{\"email\": \"$SENDGRID_TO\"}]}],\"from\": {\"email\": \"$SENDGRID_FROM\", \"name\": \"$SENDGRID_FROM_NAME\"},\"subject\": \"$_subject\",\"content\": [{\"type\": \"text/plain\", \"value\": \"$_content\"}]}"
|
||||||
|
fi
|
||||||
response="$(_post "$_data" "https://api.sendgrid.com/v3/mail/send")"
|
response="$(_post "$_data" "https://api.sendgrid.com/v3/mail/send")"
|
||||||
|
|
||||||
if [ "$?" = "0" ] && [ -z "$response" ]; then
|
if [ "$?" = "0" ] && [ -z "$response" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user