Browse Source

moved the env change check to its own function

pull/6184/head
Markus Schenk 1 week ago
parent
commit
04aefbf28d
  1. 8
      dnsapi/dns_cyon.sh

8
dnsapi/dns_cyon.sh

@ -215,10 +215,8 @@ _cyon_change_domain_env() {
if ! _cyon_check_if_2fa_missed "${domain_env_response}"; then return 1; fi if ! _cyon_check_if_2fa_missed "${domain_env_response}"; then return 1; fi
domain_env_success="$(printf "%s" "${domain_env_response}" | _egrep_o '"authenticated":\w*' | cut -d : -f 2)"
# Bail if domain environment change fails. # Bail if domain environment change fails.
if [ "${domain_env_success}" != "true" ]; then
if [ "$(printf "%s" "${domain_env_response}" | _cyon_get_envchange_success)" != "true" ]; then
_err " $(printf "%s" "${domain_env_response}" | _cyon_get_response_message)" _err " $(printf "%s" "${domain_env_response}" | _cyon_get_response_message)"
_err "" _err ""
return 1 return 1
@ -317,6 +315,10 @@ _cyon_get_response_success() {
_egrep_o '"onSuccess":"[^"]*"' | cut -d : -f 2 | tr -d '"' _egrep_o '"onSuccess":"[^"]*"' | cut -d : -f 2 | tr -d '"'
} }
_cyon_get_envchange_success() {
_egrep_o '"authenticated":\w*' | cut -d : -f 2
}
_cyon_check_if_2fa_missed() { _cyon_check_if_2fa_missed() {
# Did we miss the 2FA? # Did we miss the 2FA?
if test "${1#*multi_factor_form}" != "${1}"; then if test "${1#*multi_factor_form}" != "${1}"; then

Loading…
Cancel
Save