-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Change lower case from bash variable expansion to tr #1064
Conversation
extra715 |
checks/check_extra7101
Outdated
continue | ||
fi | ||
if [[ "${AUDIT_LOGS_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain AUDIT_LOGS enabled" "$regx" "$domain" | ||
if [[ $(echo "${AUDIT_LOGS_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this to
tr '[:upper:]' '[:lower:]' <<< "${AUDIT_LOGS_ENABLED}"
checks/check_extra715
Outdated
if [[ "${SEARCH_SLOWLOG_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain SEARCH_SLOW_LOGS enabled" "$regx" "$domain" | ||
read -r SEARCH_SLOWLOG_ENABLED INDEX_SLOWLOG_ENABLED <<< "$SLOWLOG_ENABLED" && { | ||
if [[ $(echo "${SEARCH_SLOWLOG_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous
tr '[:upper:]' '[:lower:]' <<< "${SEARCH_SLOWLOG_ENABLED}"
checks/check_extra715
Outdated
if [[ "${SEARCH_SLOWLOG_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain SEARCH_SLOW_LOGS enabled" "$regx" "$domain" | ||
read -r SEARCH_SLOWLOG_ENABLED INDEX_SLOWLOG_ENABLED <<< "$SLOWLOG_ENABLED" && { | ||
if [[ $(echo "${SEARCH_SLOWLOG_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous
tr '[:upper:]' '[:lower:]' <<< "${SEARCH_SLOWLOG_ENABLED}"
checks/check_extra715
Outdated
if [[ "${INDEX_SLOWLOG_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain INDEX_SLOW_LOGS enabled" "$regx" "$domain" | ||
|
||
if [[ $(echo "${INDEX_SLOWLOG_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous
tr '[:upper:]' '[:lower:]' <<< "${INDEX_SLOWLOG_ENABLED}"
checks/check_extra715
Outdated
if [[ "${INDEX_SLOWLOG_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain INDEX_SLOW_LOGS enabled" "$regx" "$domain" | ||
|
||
if [[ $(echo "${INDEX_SLOWLOG_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous
tr '[:upper:]' '[:lower:]' <<< "${INDEX_SLOWLOG_ENABLED}"
checks/check_extra780
Outdated
continue | ||
fi | ||
if [[ "${CHECK_IF_COGNITO_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain has Amazon Cognito authentication for Kibana enabled" "$regx" "$domain" | ||
if [[ $(echo "${CHECK_IF_COGNITO_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous
tr '[:upper:]' '[:lower:]' <<< "${CHECK_IF_COGNITO_ENABLED}"
checks/check_extra780
Outdated
continue | ||
fi | ||
if [[ "${CHECK_IF_COGNITO_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain has Amazon Cognito authentication for Kibana enabled" "$regx" "$domain" | ||
if [[ $(echo "${CHECK_IF_COGNITO_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous
tr '[:upper:]' '[:lower:]' <<< "${CHECK_IF_COGNITO_ENABLED}"
checks/check_extra785
Outdated
if [[ ${update_status,,} != "false" ]];then | ||
textInfo "$regx: Amazon ES domain $domain v$es_version has updates available" "$regx" "$domain" | ||
read -r update_status es_version <<< "${CHECK_IF_UPDATE_AVAILABLE_AND_VERSION}" && | ||
if [[ $(echo "${update_status}" | tr '[:upper:]' '[:lower:]') != "false" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous:
tr '[:upper:]' '[:lower:]' <<< "${CHECK_IF_COGNITO_ENABLED}"
checks/check_extra785
Outdated
if [[ ${update_status,,} != "false" ]];then | ||
textInfo "$regx: Amazon ES domain $domain v$es_version has updates available" "$regx" "$domain" | ||
read -r update_status es_version <<< "${CHECK_IF_UPDATE_AVAILABLE_AND_VERSION}" && | ||
if [[ $(echo "${update_status}" | tr '[:upper:]' '[:lower:]') != "false" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as in previous:
tr '[:upper:]' '[:lower:]' <<< "${CHECK_IF_COGNITO_ENABLED}"
@lazize, I have requested a few changes more related with the style we are using in the project, please check it out and thank you for your contribution !! |
checks/check_extra7101
Outdated
continue | ||
fi | ||
if [[ "${AUDIT_LOGS_ENABLED,,}" == "true" ]];then | ||
textPass "$regx: Amazon ES domain $domain AUDIT_LOGS enabled" "$regx" "$domain" | ||
if [[ $(echo "${AUDIT_LOGS_ENABLED}" | tr '[:upper:]' '[:lower:]') == "true" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this to
tr '[:upper:]' '[:lower:]' <<< "${AUDIT_LOGS_ENABLED}"
Thanks for all !! @lazize |
Context
Bash variable expansion doesn't work on old bash version from macOS
Description
Change lower case transformation from bash variable expansion to
tr '[:upper:]' '[:lower:]'
command.Fix issue #1058
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.