Browse Source

fixing shfmt issue

pull/4360/head
gui1207 2 years ago
parent
commit
8ac5ae7e56
  1. 30
      deploy/cloudhub_v2.sh

30
deploy/cloudhub_v2.sh

@ -71,7 +71,7 @@ cloudhub_v2_deploy() {
return 1
fi
# Set Anypoint Platform URL
# Set Anypoint Platform URL
if [ -z "$ANYPOINT_URL" ]; then
_debug "ANYPOINT_URL Not set, using default https://anypoint.mulesoft.com"
ANYPOINT_URL="https://anypoint.mulesoft.com"
@ -147,26 +147,26 @@ _get_tls_context_id() {
# Get Tls-Context
tls_context_response="$(_cloudhub_rest "GET" "/runtimefabric/api/organizations/$ORGANIZATION_ID/privatespaces/$CH2_PRIVATE_SPACE_ID/tlsContexts" | _normalizeJson)"
_ret="$?"
_ret="$?"
if [ "$_ret" != 0 ]; then
return 1
fi
if _contains "$tls_context_response" "\"name\":\"$_domain\"" >/dev/null; then
tlscontext_list=$(echo "$tls_context_response" | _egrep_o "\"id\":\".*\",\"name\":\"$_domain\"")
if [ "$tlscontext_list" ]; then
regex_id=".*\"id\":\"\([-._0-9A-Za-z]*\)\".*$"
tls_context_id=$(echo "$tlscontext_list" | sed -n "s/$regex_id/\1/p")
if [ "$tls_context_id" ]; then
_debug "TLS-Context id: $tls_context_id found! The script will update it."
printf "%s" "$tls_context_id"
return 0
fi
_err "Can't extract TLS-Context id from: $tlscontext_list"
return 1
tlscontext_list=$(echo "$tls_context_response" | _egrep_o "\"id\":\".*\",\"name\":\"$_domain\"")
if [ "$tlscontext_list" ]; then
regex_id=".*\"id\":\"\([-._0-9A-Za-z]*\)\".*$"
tls_context_id=$(echo "$tlscontext_list" | sed -n "s/$regex_id/\1/p")
if [ "$tls_context_id" ]; then
_debug "TLS-Context id: $tls_context_id found! The script will update it."
printf "%s" "$tls_context_id"
return 0
fi
_err "Can't extract TLS-Context id from: $tlscontext_list"
return 1
fi
fi
return 0
@ -193,7 +193,7 @@ _cloudhub_rest() {
_debug response "$response"
_debug _ret "$_ret"
if [ "$_ret" = "0" ] && { [ "$http_code" -ge 200 ] && [ "$http_code" -le 299 ];}; then
if [ "$_ret" = "0" ] && { [ "$http_code" -ge 200 ] && [ "$http_code" -le 299 ]; }; then
printf "%s" "$response"
return 0
else

Loading…
Cancel
Save