Skip to content
Snippets Groups Projects
Commit f0bf8693 authored by Recolic K's avatar Recolic K
Browse files

more check

parent 196072e8
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,19 @@ function validate_environment () { ...@@ -52,6 +52,19 @@ function validate_environment () {
echo2 "Run 'curl https://google.com -o /tmp/out.html' to see if you are victim of this error. If you are sure it's not a problem, set ANTIDOTE_DISABLE_ENV_CHECK=1 to disable the check. " echo2 "Run 'curl https://google.com -o /tmp/out.html' to see if you are victim of this error. If you are sure it's not a problem, set ANTIDOTE_DISABLE_ENV_CHECK=1 to disable the check. "
return 1 return 1
} }
echo -n "$cis_bearer" | grep -P '\x0d' > /dev/null && {
echo2 "Warning: Your cis_bearer variable contains carriage return character (0x0d). You must remove it or it will cause CIS API to return 400 or other error states. "
echo2 "ENV_CHECK will discard these bad characters and program will continue running. "
echo2 "If you don't want it, set ANTIDOTE_DISABLE_ENV_CHECK=1 to disable the check."
cis_bearer=$(echo -n "$cis_bearer" | tr -d '\r')
}
grep -P '[^\x00-\x7f]' --text "$(where_am_i)/antidote.config.sh" && {
echo2 "Warning: Your configuration file '$(where_am_i)/antidote.config.sh' contains non-ASCII character. "
echo2 "It's very likely to cause some hidden API error. Please carefully remove all non-ASCII special characters. "
echo2 "If you are sure it's not a problem, set ANTIDOTE_DISABLE_ENV_CHECK=1 to disable the check. "
grep -P '[^\x00-\x7f]' --text --color=always "$(where_am_i)/antidote.config.sh"
return 1
}
} }
############################################################################## ##############################################################################
...@@ -366,7 +379,7 @@ function subcmd_xmldownload () { ...@@ -366,7 +379,7 @@ function subcmd_xmldownload () {
} }
# Initialization # Initialization
antidote_version="1.1.12-2" antidote_version="1.1.12-3"
subcmd="$1" subcmd="$1"
shift shift
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment