Browse Source

format adjustment

pull/5061/head
b1n23 9 months ago
parent
commit
bfba44fbad
  1. 2
      deploy/edgio.sh
  2. 8
      deploy/keyhelp.sh

2
deploy/edgio.sh

@ -54,7 +54,7 @@ edgio_deploy() {
_info "Getting access token" _info "Getting access token"
_data="client_id=$EDGIO_CLIENT_ID&client_secret=$EDGIO_CLIENT_SECRET&grant_type=client_credentials&scope=app.config" _data="client_id=$EDGIO_CLIENT_ID&client_secret=$EDGIO_CLIENT_SECRET&grant_type=client_credentials&scope=app.config"
_debug Get_access_token_data "$_data" _debug Get_access_token_data "$_data"
_response=$(_post "$_data" "https://id.edgio.app/connect/token" "" "POST" "application/x-www-form-urlencoded" )
_response=$(_post "$_data" "https://id.edgio.app/connect/token" "" "POST" "application/x-www-form-urlencoded")
_debug Get_access_token_response "$_response" _debug Get_access_token_response "$_response"
_access_token=$(echo "$_response" | _json_decode | _egrep_o '"access_token":"[^"]*' | cut -d : -f 2 | tr -d '"') _access_token=$(echo "$_response" | _json_decode | _egrep_o '"access_token":"[^"]*' | cut -d : -f 2 | tr -d '"')
_debug _access_token "$_access_token" _debug _access_token "$_access_token"

8
deploy/keyhelp.sh

@ -92,8 +92,8 @@ keyhelp_deploy() {
target_type=$(echo "$_response" | grep 'target_type' | grep 'checked' | sed -n 's/.*value="\([^"]*\).*/\1/p') target_type=$(echo "$_response" | grep 'target_type' | grep 'checked' | sed -n 's/.*value="\([^"]*\).*/\1/p')
_debug "cert_value" "$cert_value" _debug "cert_value" "$cert_value"
if [ -z "$cert_value" ]; then if [ -z "$cert_value" ]; then
_err "Fail to get certificate id."
return 1
_err "Fail to get certificate id."
return 1
fi fi
_request_body="submit=1&id=$DOMAIN_ID&target_type=$target_type&certificate_type=custom&certificate_id=$cert_value" _request_body="submit=1&id=$DOMAIN_ID&target_type=$target_type&certificate_type=custom&certificate_id=$cert_value"
@ -101,8 +101,8 @@ keyhelp_deploy() {
_message=$(echo "$_response" | grep -A 2 'message-body' | sed -n '/<div class="message-body ">/,/<\/div>/{//!p;}' | sed 's/<[^>]*>//g' | sed 's/^ *//;s/ *$//') _message=$(echo "$_response" | grep -A 2 'message-body' | sed -n '/<div class="message-body ">/,/<\/div>/{//!p;}' | sed 's/<[^>]*>//g' | sed 's/^ *//;s/ *$//')
_info "_message" "$_message" _info "_message" "$_message"
if [ -z "$_message" ]; then if [ -z "$_message" ]; then
_err "Fail to apply certificate."
return 1
_err "Fail to apply certificate."
return 1
fi fi
done done

Loading…
Cancel
Save