Skip to content

Commit

Permalink
fix lint iissues
Browse files Browse the repository at this point in the history
  • Loading branch information
s1saurabh committed Aug 30, 2024
1 parent f23f059 commit b777da4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ####################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ####################

Expand Down Expand Up @@ -94,18 +101,19 @@ 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

if [ -z "${REGISTRATION_INVITED_NODES}" ]; then
REGISTRATION_INVITED_NODES='*'
else
# shellcheck disable=SC2034
REGINVITEDNODESET=1
fi

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -192,6 +201,7 @@ do

dbhost_map[${HOST}]=${IP}
rule_map[${HOST}]=${db_hostvalue}
# shellcheck disable=SC2178
rule_env_vars=""
done

Expand Down Expand Up @@ -254,6 +264,7 @@ return 0

setupEtcResolvConf()
{
# shellcheck disable=SC2034
local stat=3

if [ "$action" == "" ]; then
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -44,6 +46,7 @@ resolveip(){
then
return 1
else
# shellcheck disable=SC2155
local ip=$( getent hosts "$host" | awk '{print $1}' )
if [ -z "$ip" ]
then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#

usage() {
# shellcheck disable=SC2045
cat << EOF
Usage: buildDockerImage.sh -v [version] [-i] [-t] [-o] [Docker build option]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b777da4

Please sign in to comment.