From 645ecac93f6d9ce73ee25f862dabcea6639c1c73 Mon Sep 17 00:00:00 2001 From: Cory Latschkowski Date: Tue, 4 Jun 2024 16:59:17 -0500 Subject: [PATCH] update: user msgs (#87) --- scripts/automate_operators.sh | 13 +++++++++++-- scripts/bootstrap.sh | 10 +++++++++- scripts/functions.sh | 10 ++++++++-- scripts/library/common.sh | 11 +++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/scripts/automate_operators.sh b/scripts/automate_operators.sh index 3a7bda0c..d8c596df 100755 --- a/scripts/automate_operators.sh +++ b/scripts/automate_operators.sh @@ -1,9 +1,18 @@ #!/bin/bash # set -x +# shellcheck disable=SC2034 + +RED='\033[1;31m' +BLUE='\033[1;36m' +PURPLE='\033[1;35m' +ORANGE='\033[0;33m' +NC='\033[0m' # No Color + check_shell(){ - [[ "${0}" =~ "bash" ]] && return - echo "Please verify you are running in bash shell" + [ -n "$BASH_VERSION" ] && return + echo -e "${ORANGE}WARNING: These scripts are ONLY tested in a bash shell${NC}" + sleep "${SLEEP_SECONDS:-8}" } check_shell diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index cab9b30b..e6ed8daf 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -1,14 +1,22 @@ #!/bin/bash # set -e +# shellcheck disable=SC2034 + # 8 seconds is usually enough time for the average user to realize they foobar export SLEEP_SECONDS=8 ################# standard init ################# +RED='\033[1;31m' +BLUE='\033[1;36m' +PURPLE='\033[1;35m' +ORANGE='\033[0;33m' +NC='\033[0m' # No Color + check_shell(){ [ -n "$BASH_VERSION" ] && return - echo "Please verify you are running in bash shell" + echo -e "${ORANGE}WARNING: These scripts are ONLY tested in a bash shell${NC}" sleep "${SLEEP_SECONDS:-8}" } diff --git a/scripts/functions.sh b/scripts/functions.sh index 93fdddc9..0d4ad2bc 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -1,9 +1,15 @@ #!/bin/bash -# shellcheck disable=SC1091 +# shellcheck disable=SC1091,SC2034 + +RED='\033[1;31m' +BLUE='\033[1;36m' +PURPLE='\033[1;35m' +ORANGE='\033[0;33m' +NC='\033[0m' # No Color check_shell(){ [ -n "$BASH_VERSION" ] && return - echo "Please verify you are running in bash shell" + echo -e "${ORANGE}WARNING: These scripts are ONLY tested in a bash shell${NC}" sleep "${SLEEP_SECONDS:-8}" } diff --git a/scripts/library/common.sh b/scripts/library/common.sh index 95c203cf..ac2c1c08 100644 --- a/scripts/library/common.sh +++ b/scripts/library/common.sh @@ -1,5 +1,16 @@ #!/bin/bash +# shellcheck disable=SC2034 +RED='\033[1;31m' +BLUE='\033[1;36m' +PURPLE='\033[1;35m' +ORANGE='\033[0;33m' +NC='\033[0m' # No Color + +# echo -e "${BLUE}INFO:${NC} +# echo -e "${RED}ERROR:${NC} +# echo -e "${ORANGE}WARNING:${NC} + # https://docs.openshift.com/container-platform/4.12/backup_and_restore/application_backup_and_restore/troubleshooting.html#velero-obtaining-by-accessing-binary_oadp-troubleshooting alias velero='oc -n openshift-adp exec deployment/velero -c velero -it -- ./velero'