Skip to content

Commit 7c18374

Browse files
committed
lint fixes
1 parent cfb939f commit 7c18374

File tree

14 files changed

+69
-30
lines changed

14 files changed

+69
-30
lines changed

OracleDatabase/RAC/OracleRACStorageServer/containerfiles/latest/runOracle.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@
1111
#
1212

1313
if [ -f /etc/storage_env_vars ]; then
14+
# shellcheck disable=SC1091
1415
source /etc/storage_env_vars
1516
fi
1617

1718
logfile="/tmp/storage_setup.log"
1819

1920
touch $logfile
2021
chmod 666 $logfile
22+
# shellcheck disable=SC2034,SC2086
2123
progname="$(basename $0)"
2224

2325
####################### Constants #################
26+
# shellcheck disable=SC2034
2427
declare -r FALSE=1
28+
# shellcheck disable=SC2034
2529
declare -r TRUE=0
2630
export REQUIRED_SPACE_GB=55
2731
export ORADATA=/oradata
@@ -32,10 +36,12 @@ export FILE_COUNT=0
3236
check_space ()
3337
{
3438
local REQUIRED_SPACE_GB=$1
35-
39+
# shellcheck disable=SC2006
3640
AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'`
3741
if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then
42+
# shellcheck disable=SC2086
3843
if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then
44+
# shellcheck disable=SC2006
3945
script_name=`basename "$0"`
4046
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" | tee -a $logfile
4147
echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA." | tee -a $logfile
@@ -52,8 +58,9 @@ check_space ()
5258
setupEtcResolvConf()
5359
{
5460
local stat=3
55-
61+
# shellcheck disable=SC2154
5662
if [ "$action" == "" ]; then
63+
# shellcheck disable=SC2236
5764
if [ ! -z "${DNS_SERVER}" ] ; then
5865
sudo sh -c "echo \"search ${DOMAIN}\" > /etc/resolv.conf"
5966
sudo sh -c "echo \"nameserver ${DNS_SERVER}\" >> /etc/resolv.conf"
@@ -64,9 +71,12 @@ fi
6471

6572
SetupEtcHosts()
6673
{
74+
# shellcheck disable=SC2034
6775
local stat=3
76+
# shellcheck disable=SC2034
6877
local HOST_LINE
6978
if [ "$action" == "" ]; then
79+
# shellcheck disable=SC2236
7080
if [ ! -z "${HOSTFILE}" ]; then
7181
if [ -f "${HOSTFILE}" ]; then
7282
sudo sh -c "cat \"${HOSTFILE}\" > /etc/hosts"
@@ -91,7 +101,7 @@ fi
91101
echo "$ORADATA dir doesn't exist! exiting" | tee -a $logfile
92102
exit 1
93103
fi
94-
104+
# shellcheck disable=SC2086
95105
if [ -z $ASM_STORAGE_SIZE_GB ] ;then
96106
echo "ASM_STORAGE_SIZE env variable is not defined! Assigning 50GB default" | tee -a $logfile
97107
ASM_STORAGE_SIZE_GB=50
@@ -107,6 +117,7 @@ fi
107117

108118
echo "Checking Space" | tee -a $logfile
109119
check_space $ASM_STORAGE_SIZE_GB
120+
# shellcheck disable=SC2004
110121
ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5))
111122
count=1;
112123
while [ $count -le 5 ];
@@ -119,12 +130,12 @@ fi
119130
else
120131
echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation" | tee -a $logfile
121132
fi
122-
133+
# shellcheck disable=SC2004
123134
count=$(($count+1))
124135
done
125-
136+
# shellcheck disable=SC2012
126137
FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l)
127-
138+
# shellcheck disable=SC2086
128139
if [ ${FILE_COUNT} -ge 5 ];then
129140
echo "Touching ${INSTALL_COMPLETED_FILE}" | tee -a $logfile
130141
touch ${INSTALL_COMPLETED_FILE}
@@ -147,6 +158,7 @@ fi
147158
systemctl status rpcbind.service | tee -a $logfile
148159

149160
echo "Setting up /etc/exports"
161+
# shellcheck disable=SC2086,SC2002
150162
cat $SCRIPT_DIR/$EXPORTFILE | tee -a /etc/exports
151163

152164
echo "Exporting File System"

OracleDatabase/RAC/OracleRACStorageServer/containerfiles/latest/setupLinuxEnv.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
mkdir /oradata && \
1616
chmod ug+x /opt/scripts/startup/*.sh && \
1717
if grep -q "Oracle Linux Server release 9" /etc/oracle-release; then \
18-
# curl --noproxy '*' https://ca-artifacts.oraclecorp.com/auto-build/x86_64-build-output-9-dev/oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm --output oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm && \
19-
# dnf install -y oracle-database-preinstall-23ai-1.0-2.el9.x86_64.rpm cronie && \
2018
dnf install -y oracle-database-preinstall-23ai && \
2119
cp /etc/security/limits.d/oracle-database-preinstall-23ai.conf /etc/security/limits.d/grid-database-preinstall-23ai.conf && \
2220
sed -i 's/oracle/grid/g' /etc/security/limits.d/grid-database-preinstall-23ai.conf && \

OracleDatabase/RAC/OracleRACStorageServer/containerfiles/ol7/Containerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
# ---------------
1717
FROM oraclelinux:7-slim
1818

19-
# Maintainer
20-
# ----------
21-
MAINTAINER Paramdeep saini <[email protected]>, Sanjay Singh <[email protected]>
22-
2319
# Environment variables required for this build (do NOT change)
2420
# -------------------------------------------------------------
2521
# Linux Env Variable
@@ -58,4 +54,4 @@ WORKDIR /home/oracle
5854

5955
# Define default command to start Oracle Database.
6056

61-
CMD exec $SCRIPT_DIR/$RUN_FILE
57+
CMD ["exec", "$SCRIPT_DIR/$RUN_FILE"]

OracleDatabase/RAC/OracleRACStorageServer/containerfiles/ol7/runOracle.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@
1111
#
1212

1313
if [ -f /etc/rac_env_vars ]; then
14+
# shellcheck disable=SC1091
1415
source /etc/rac_env_vars
1516
fi
1617
logfile="/tmp/orod.log"
1718

1819
touch $logfile
1920
chmod 666 /tmp/orod.log
21+
# shellcheck disable=SC2086,SC2034
2022
progname="$(basename $0)"
2123

2224
####################### Constants #################
25+
# shellcheck disable=SC2034
2326
declare -r FALSE=1
2427
declare -r TRUE=0
2528
export REQUIRED_SPACE_GB=55
@@ -31,10 +34,13 @@ export FILE_COUNT=0
3134
check_space ()
3235
{
3336
local REQUIRED_SPACE_GB=$1
34-
37+
# shellcheck disable=SC2006,SC2086
3538
AVAILABLE_SPACE_GB=`df -B 1G $ORADATA | tail -n 1 | awk '{print $4}'`
39+
# shellcheck disable=SC1009
3640
if [ ! -f ${INSTALL_COMPLETED_FILE} ] ;then
41+
# shellcheck disable=SC2086
3742
if [ $AVAILABLE_SPACE_GB -lt $REQUIRED_SPACE_GB ]; then
43+
# shellcheck disable=SC2006
3844
script_name=`basename "$0"`
3945
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
4046
echo "$script_name: ERROR - There is not enough space available in the docker container under $ORADATA."
@@ -77,6 +83,7 @@ touch /tmp/sigterm
7783
########### SIGKILL handler ############
7884
function _kill() {
7985
echo "SIGKILL received, shutting down database!"
86+
# shellcheck disable=SC2034
8087
local cmd
8188
echo "Stopping nfs server"
8289
sudo /usr/sbin/rpc.nfsd 0
@@ -100,13 +107,14 @@ trap _int SIGINT
100107
trap _term SIGTERM
101108

102109
# Set SIGKILL handler
110+
# shellcheck disable=SC2173
103111
trap _kill SIGKILL
104112

105113
if [ ! -d "$ORADATA" ] ;then
106114
echo "$ORADATA dir doesn't exist! exiting"
107115
exit 1
108116
fi
109-
117+
# shellcheck disable=SC2086
110118
if [ -z $ASM_STORAGE_SIZE_GB ] ;then
111119
echo "ASM_STORAGE_SIZE env variable is not defined! Assigning 50GB default"
112120
ASM_STORAGE_SIZE_GB=50
@@ -119,6 +127,7 @@ sudo chown -R oracle:oinstall /oradata
119127

120128
echo "Checking Space"
121129
check_space $ASM_STORAGE_SIZE_GB
130+
# shellcheck disable=SC2004
122131
ASM_DISKS_SIZE=$(($ASM_STORAGE_SIZE_GB/5))
123132
count=1;
124133
while [ $count -le 5 ];
@@ -130,12 +139,12 @@ dd if=/dev/zero of=$ORADATA/asm_disk0$count.img bs=1G count=$ASM_DISKS_SIZE
130139
else
131140
echo "$ORADATA/asm_disk0$count.img file already exist! Skipping file creation"
132141
fi
133-
142+
# shellcheck disable=SC2004
134143
count=$(($count+1))
135144
done
136-
145+
# shellcheck disable=SC2012
137146
FILE_COUNT=$(ls $ORADATA/asm_disk0* | wc -l)
138-
147+
# shellcheck disable=SC2086
139148
if [ ${FILE_COUNT} -ge 5 ];then
140149
echo "Touching ${INSTALL_COMPLETED_FILE}"
141150
touch ${INSTALL_COMPLETED_FILE}
@@ -147,6 +156,7 @@ echo "#################################################"
147156

148157

149158
echo "Setting up /etc/exports"
159+
# shellcheck disable=SC2086,SC2002
150160
cat $SCRIPT_DIR/$EXPORTFILE | sudo tee -a /etc/exports
151161

152162
echo "Starting RPC Bind "
@@ -165,8 +175,9 @@ sudo /usr/sbin/rpc.mountd --manage-gids
165175
sudo /usr/sbin/rpc.rquotad
166176

167177
echo "Checking NFS server"
178+
# shellcheck disable=SC2006,SC2196,SC2126
168179
PROC_COUNT=`ps aux | egrep 'rpcbind|mountd|nfsd' | grep -v "grep -E rpcbind|mountd|nfsd" | wc -l`
169-
180+
# shellcheck disable=SC2086
170181
if [ $PROC_COUNT -gt 1 ]; then
171182
echo "####################################################"
172183
echo " NFS Server is up and running "

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/GridHomeCleanup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#
1212

1313
# Image Cleanup Script
14-
14+
# shellcheck disable=SC1090
1515
source /home/"${GRID_USER}"/.bashrc
16-
16+
# shellcheck disable=SC2034
1717
ORACLE_HOME=${GRID_HOME}
1818

1919
rm -rf /u01/app/grid/*

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/OracleHomeCleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212

1313
# Image Cleanup Script
14-
14+
# shellcheck disable=SC1090
1515
source /home/"${DB_USER}"/.bashrc
1616
ORACLE_HOME=${DB_HOME}
1717

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/enableRAC.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# Description: Enable RAC feature in Oracle Software
99
#
1010
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
11-
11+
# shellcheck disable=SC1090
1212
source /home/"${DB_USER}"/.bashrc
1313

1414
export ORACLE_HOME=${DB_HOME}

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/functions.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export TOP_PID=$$
1818

1919
###### Function Related to printing messages and exit the script if error occurred ##################
2020
error_exit() {
21+
# shellcheck disable=SC2155
2122
local NOW=$(date +"%m-%d-%Y %T %Z")
2223
# Display error message and exit
2324
# echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
@@ -27,6 +28,7 @@ local NOW=$(date +"%m-%d-%Y %T %Z")
2728

2829
print_message ()
2930
{
31+
# shellcheck disable=SC2155
3032
local NOW=$(date +"%m-%d-%Y %T %Z")
3133
# Display message and return
3234
echo "${NOW} : ${PROGNAME} : ${1:-"Unknown Message"}" | tee -a $logfile > $STD_OUT_FILE
@@ -99,6 +101,7 @@ valid_ip()
99101
if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
100102
OIFS=$IFS
101103
IFS='.'
104+
# shellcheck disable=SC2206
102105
ip=($ip)
103106
IFS=$OIFS
104107
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
@@ -114,7 +117,7 @@ host_alive()
114117
local ip_or_hostname=$1
115118
local stat=1
116119
ping -c 1 -W 1 "$ip_or_hostname" >& /dev/null
117-
120+
# shellcheck disable=SC2181
118121
if [ $? -eq 0 ]; then
119122
stat=0
120123
return $stat
@@ -132,19 +135,25 @@ resolveip(){
132135
then
133136
return 1
134137
else
138+
# shellcheck disable=SC2155,SC2178
135139
local ip=$( getent hosts "$host" | awk '{print $1}' )
140+
# shellcheck disable=SC2128
136141
if [ -z "$ip" ]
137142
then
143+
# shellcheck disable=SC2178
138144
ip=$( dig +short "$host" )
145+
# shellcheck disable=SC2128
139146
if [ -z "$ip" ]
140147
then
141148
print_message "unable to resolve '$host'"
142149
return 1
143150
else
151+
# shellcheck disable=SC2128
144152
print_message "$ip"
145153
return 0
146154
fi
147155
else
156+
# shellcheck disable=SC2128
148157
print_message "$ip"
149158
return 0
150159
fi

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/19.3.0/installDBBinaries.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ if [ "$EDITION" == "" ]; then
2020
fi;
2121

2222
# Check whether correct edition has been passed on
23+
# shellcheck disable=SC2166
2324
if [ "$EDITION" != "EE" -a "$EDITION" != "SE2" ]; then
2425
echo "ERROR: Wrong edition has been passed on!"
2526
echo "Edition $EDITION is no a valid edition!"
@@ -59,5 +60,6 @@ fi
5960

6061

6162
# Install Oracle binaries
63+
# shellcheck disable=SC2015
6264
unzip -q "$INSTALL_SCRIPTS"/"$INSTALL_FILE_2" -d "$DB_HOME" && \
6365
"$DB_HOME"/runInstaller -silent -force -waitforcompletion -responsefile "$INSTALL_SCRIPTS"/"$DB_INSTALL_RSP" -ignorePrereqFailure || true

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/21.3.0/GridHomeCleanup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#
1212

1313
# Image Cleanup Script
14-
14+
# shellcheck disable=SC1090
1515
source /home/"${GRID_USER}"/.bashrc
16-
16+
# shellcheck disable=SC2034
1717
ORACLE_HOME=${GRID_HOME}
1818

1919
rm -rf /u01/app/grid/*

0 commit comments

Comments
 (0)