From b777da436d9f7fa4024b4933ab2edb5ec5bdc20d Mon Sep 17 00:00:00 2001 From: Saurabh Ahuja Date: Fri, 30 Aug 2024 13:18:12 +0000 Subject: [PATCH] fix lint iissues --- .../containerfiles/19.3.0/configCMAN.sh | 1 + .../21.3.0/installDBBinaries.sh | 1 + .../containerfiles/23.5.0/configCMAN.sh | 21 +++++++++++++++---- .../containerfiles/23.5.0/functions.sh | 3 +++ .../containerfiles/buildContainerImage.sh | 2 ++ 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh index 041c2b2637..1736878132 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/19.3.0/configCMAN.sh @@ -21,6 +21,7 @@ declare -r FALSE=1 declare -r TRUE=0 # shellcheck disable=SC2034 declare -r ETCHOSTS="/etc/hosts" +# shellcheck disable=SC2034 progname="$(basename $0)" ###################### Constants #################### diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh index 2625572878..d9b5fe3d83 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/21.3.0/installDBBinaries.sh @@ -20,6 +20,7 @@ if [ "$EDITION" == "" ]; then fi; # Check whether correct edition has been passed on +# shellcheck disable=SC2166 if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then echo "ERROR: Wrong edition has been passed on!" echo "Edition $EDITION is no a valid edition!" diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh index 4b34062967..16581b0366 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/configCMAN.sh @@ -12,14 +12,21 @@ source $SCRIPT_DIR/functions.sh ####################### Constants ################# +# shellcheck disable=SC2034 declare -r FALSE=1 +# shellcheck disable=SC2034 declare -r TRUE=0 +# shellcheck disable=SC2034 declare -r ETCHOSTS="/etc/hosts" +# shellcheck disable=SC2034 declare -A dbhost_map +# shellcheck disable=SC2034 declare -A rule_map +# shellcheck disable=SC2034 declare hostip +# shellcheck disable=SC2034 declare action="" - +# shellcheck disable=SC2034 progname="$(basename $0)" ###################### Constants #################### @@ -94,11 +101,11 @@ fi if [ -z "${TRACE_LEVEL}" ]; then TRACE_LEVEL=user fi - +# shellcheck disable=SC2166 if [ "${TRACE_LEVEL}" != "user" -a "${TRACE_LEVEL}" != "admin" -a "${TRACE_LEVEL}" != "support" ]; then print_message "Invalid trace-level [${TRACE_LEVEL}] specified." fi - +# shellcheck disable=SC2166 if [ "${LOG_LEVEL}" != "user" -a "${LOG_LEVEL}" != "admin" -a "${LOG_LEVEL}" != "support" ]; then print_message "Invalid log-level [${LOG_LEVEL}] specified." fi @@ -106,6 +113,7 @@ fi if [ -z "${REGISTRATION_INVITED_NODES}" ]; then REGISTRATION_INVITED_NODES='*' else +# shellcheck disable=SC2034 REGINVITEDNODESET=1 fi @@ -162,7 +170,7 @@ if [ $RULESRVSET -eq 1 ]; then print_message "Invalid input. SrvIP [${RULE_SRV}] not a valid subnet. " fi fi - +# shellcheck disable=SC2166 if [ "${RULE_ACT}" != "accept" -a "${RULE_ACT}" != "reject" -a "${RULE_ACT}" != "drop" ]; then print_message "Invalid rule-action [${RULE_ACT}] specified." fi @@ -181,6 +189,7 @@ do for rule_env_var in "${rule_env_vars[@]}" do echo "export ${rule_env_var}" +# shellcheck disable=SC2163 export ${rule_env_var} done @@ -192,6 +201,7 @@ do dbhost_map[${HOST}]=${IP} rule_map[${HOST}]=${db_hostvalue} +# shellcheck disable=SC2178 rule_env_vars="" done @@ -254,6 +264,7 @@ return 0 setupEtcResolvConf() { +# shellcheck disable=SC2034 local stat=3 if [ "$action" == "" ]; then @@ -267,7 +278,9 @@ fi SetupEtcHosts() { +# shellcheck disable=SC2034 local stat=3 +# shellcheck disable=SC2034 local HOST_LINE if [ "$action" == "" ]; then if [ ! -z "${HOSTFILE}" ]; then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh index 8563caa622..41f00d300f 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/23.5.0/functions.sh @@ -19,6 +19,7 @@ export STD_ERR_FILE="/proc/self/fd/2" ###### Function Related to printing messages and exit the script if error occurred ################## error_exit() { +# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display error message and exit # echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 @@ -28,6 +29,7 @@ local NOW=$(date +"%m-%d-%Y %T %Z") print_message () { +# shellcheck disable=SC2155 local NOW=$(date +"%m-%d-%Y %T %Z") # Display message and return echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE @@ -44,6 +46,7 @@ resolveip(){ then return 1 else +# shellcheck disable=SC2155 local ip=$( getent hosts "$host" | awk '{print $1}' ) if [ -z "$ip" ] then diff --git a/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh b/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh index 5f9ab02841..4fe4993a55 100755 --- a/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh +++ b/OracleDatabase/OracleConnectionManager/containerfiles/buildContainerImage.sh @@ -9,6 +9,7 @@ # usage() { +# shellcheck disable=SC2045 cat << EOF Usage: buildDockerImage.sh -v [version] [-i] [-t] [-o] [Docker build option] @@ -38,6 +39,7 @@ checksumPackages() { if [ "$?" -ne 0 ]; then echo "MD5 for required packages to build this image did not match!" echo "Make sure to download missing files in folder $VERSION." +# shellcheck disable=SC2320 exit $? fi else