Unverified Commit 884f70fb authored by Armando Lüscher's avatar Armando Lüscher
Browse files

Remove square brackets from ranges.

Export curl header variables.
parent 9499a114
...@@ -74,14 +74,14 @@ _cyon_load_credentials() { ...@@ -74,14 +74,14 @@ _cyon_load_credentials() {
} }
_cyon_is_idn() { _cyon_is_idn() {
_idn_temp="$(printf "%s" "${1}" | tr -d "[0-9a-zA-Z.,-_]")" _idn_temp="$(printf "%s" "${1}" | tr -d "0-9a-zA-Z.,-_")"
_idn_temp2="$(printf "%s" "${1}" | grep -o "xn--")" _idn_temp2="$(printf "%s" "${1}" | grep -o "xn--")"
[ "$_idn_temp" ] || [ "$_idn_temp2" ] [ "$_idn_temp" ] || [ "$_idn_temp2" ]
} }
_cyon_load_parameters() { _cyon_load_parameters() {
# Read the required parameters to add the TXT entry. # Read the required parameters to add the TXT entry.
fulldomain="$(printf "%s" "${1}" | tr '[A-Z]' '[a-z]')" fulldomain="$(printf "%s" "${1}" | tr "A-Z" "a-z")"
fulldomain_idn="${fulldomain}" fulldomain_idn="${fulldomain}"
# Special case for IDNs, as cyon needs a domain environment change, # Special case for IDNs, as cyon needs a domain environment change,
...@@ -105,6 +105,7 @@ _cyon_load_parameters() { ...@@ -105,6 +105,7 @@ _cyon_load_parameters() {
# This header is required for curl calls. # This header is required for curl calls.
_H1="X-Requested-With: XMLHttpRequest" _H1="X-Requested-With: XMLHttpRequest"
export _H1
} }
_cyon_print_header() { _cyon_print_header() {
...@@ -155,6 +156,8 @@ _cyon_login() { ...@@ -155,6 +156,8 @@ _cyon_login() {
# NECESSARY!! Load the main page after login, to get the new cookie. # NECESSARY!! Load the main page after login, to get the new cookie.
_H2="$(_cyon_get_cookie_header)" _H2="$(_cyon_get_cookie_header)"
export _H2
_get "https://my.cyon.ch/" >/dev/null _get "https://my.cyon.ch/" >/dev/null
# todo: instead of just checking if the env variable is defined, check if we actually need to do a 2FA auth request. # todo: instead of just checking if the env variable is defined, check if we actually need to do a 2FA auth request.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment