Skip to content

Commit 5a5345f

Browse files
committed
lint fixes
1 parent 7c18374 commit 5a5345f

File tree

4 files changed

+29
-54
lines changed

4 files changed

+29
-54
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1111
#
12-
12+
# shellcheck disable=SC2034
1313
EDITION=$1
1414

1515
# Create Directories
@@ -33,6 +33,7 @@ if [ "${SLIMMING}x" != 'truex' ] ; then
3333
chown -R "${GRID_USER}":oinstall "$GRID_HOME"
3434
mkdir -p "$INVENTORY"
3535
chown -R "${GRID_USER}":oinstall "$INVENTORY"
36+
# shellcheck disable=SC2129
3637
echo "export PATH=$GRID_PATH" >> /home/"${GRID_USER}"/.bashrc
3738
echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/"${GRID_USER}"/.bashrc
3839
echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${GRID_USER}"/.bashrc

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

Lines changed: 0 additions & 41 deletions
This file was deleted.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1111
#
12-
12+
# shellcheck disable=SC2034
1313
EDITION=$1
1414

1515
# Create Directories
@@ -33,6 +33,7 @@ if [ "${SLIMMING}x" != 'truex' ] ; then
3333
chown -R "${GRID_USER}":oinstall "$GRID_HOME"
3434
mkdir -p "$INVENTORY"
3535
chown -R "${GRID_USER}":oinstall "$INVENTORY"
36+
# shellcheck disable=SC2129
3637
echo "export PATH=$GRID_PATH" >> /home/"${GRID_USER}"/.bashrc
3738
echo "export LD_LIBRARY_PATH=$GRID_LD_LIBRARY_PATH" >> /home/"${GRID_USER}"/.bashrc
3839
echo "export SCRIPT_DIR=$SCRIPT_DIR" >> /home/"${GRID_USER}"/.bashrc

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/setup_rac_host.sh

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ SLIMENV=0
55
IGNOREOSVERSION=0
66
validate_environment_variables() {
77
local podman_compose_file="$1"
8+
# shellcheck disable=SC2207,SC2016
89
local env_variables=($(grep -oP '\${\K[^}]*' "$podman_compose_file" | sort -u))
910
local missing_variables=()
1011

@@ -460,18 +461,20 @@ allow container_init_t textrel_shlib_t:file setattr;
460461
allow container_init_t kernel_t:system syslog_read;
461462
allow container_init_t unlabeled_t:file read;
462463
EOF
463-
464+
# shellcheck disable=SC2164
464465
cd /var/opt
465466
make -f /usr/share/selinux/devel/Makefile rac-podman.pp
466467
semodule -i rac-podman.pp
467468
semodule -l | grep rac-pod
468469
sleep 3
469-
470+
# shellcheck disable=SC2145
470471
echo "INFO: Setting SEContext for ${nodeHomeValues[@]}"
471472
for nodeHome in "${nodeHomeValues[@]}"
472473
do
473474
echo "INFO: Setting context for $nodeHome"
475+
# shellcheck disable=SC2086
474476
semanage fcontext -a -t container_file_t $nodeHome
477+
# shellcheck disable=SC2086
475478
restorecon -vF $nodeHome
476479
done
477480
return 0
@@ -483,13 +486,16 @@ delete_and_create_secret() {
483486
local file_path=$2
484487

485488
# Check if the secret exists
489+
# shellcheck disable=SC2086
486490
if podman secret inspect $secret_name &> /dev/null; then
487491
echo "INFO: Deleting existing secret $secret_name..."
492+
# shellcheck disable=SC2086
488493
podman secret rm $secret_name
489494
fi
490495

491496
# Create the new secret
492497
echo "INFO: Creating new secret $secret_name..."
498+
# shellcheck disable=SC2086
493499
podman secret create $secret_name $file_path
494500
}
495501

@@ -500,7 +506,9 @@ create_secrets() {
500506
return 1
501507
fi
502508
mkdir -p /opt/.secrets/
509+
# shellcheck disable=SC2086
503510
echo $RAC_SECRET > /opt/.secrets/pwdfile.txt
511+
# shellcheck disable=SC2164
504512
cd /opt/.secrets
505513
openssl genrsa -out key.pem
506514
openssl rsa -in key.pem -out key.pub -pubout
@@ -510,6 +518,7 @@ create_secrets() {
510518
delete_and_create_secret "pwdsecret" "/opt/.secrets/pwdfile.enc"
511519
delete_and_create_secret "keysecret" "/opt/.secrets/key.pem"
512520
echo "INFO: Secrets created."
521+
# shellcheck disable=SC2164
513522
cd -
514523
return 0
515524
}
@@ -550,25 +559,26 @@ setup_host_prepreq(){
550559
fi
551560

552561
echo "INFO: Setting Podman env on OS [${OSVersion}]"
553-
# shellcheck disable=SC2006
562+
# shellcheck disable=SC2006,SC2086
554563
kernelVersion=`uname -r | cut -d. -f1,2`
555-
# shellcheck disable=SC2006
564+
# shellcheck disable=SC2006,SC2086
556565
majorKernelVersion=`echo ${kernelVersion} | cut -d. -f1`
557-
# shellcheck disable=SC2006
566+
# shellcheck disable=SC2006,SC2086
558567
minorKernelVersion=`echo ${kernelVersion} | cut -d. -f2`
559568

560569
echo "Running on Kernel [${kernelVersion}]"
561-
570+
# shellcheck disable=SC2006,SC2086
562571
if [ ${majorKernelVersion} -lt 5 ]; then
563572
kernelVersionSupported=0
564573
fi
565-
574+
# shellcheck disable=SC2086
566575
if [ $majorKernelVersion -eq 5 ]; then
576+
# shellcheck disable=SC2086
567577
if [ ${minorKernelVersion} -lt 14 ]; then
568578
kernelVersionSupported=0
569579
fi
570580
fi
571-
581+
# shellcheck disable=SC2166
572582
if [ $OSVersionSupported -eq 0 -o $kernelVersionSupported -eq 0 ]; then
573583
if [ ${IGNOREOSVERSION} == "0" ]; then
574584
echo "ERROR: OSVersion=${OSVersion}.. KernelVersion=${kernelVersion}. Exiting."
@@ -594,12 +604,14 @@ setup_host_prepreq(){
594604
DisplayUsage
595605
return 1
596606
fi
597-
# shellcheck disable=SC2006
607+
# shellcheck disable=SC2006,SC2001,SC2086
598608
nodeHomeDirs=`echo ${node_dirs} | sed -e 's/.*?=\(.*\)/\1/g'`
609+
# shellcheck disable=SC2162
599610
IFS=',' read -a nodeHomeValues <<< "${nodeHomeDirs}"
600611
for nodeHome in "${nodeHomeValues[@]}"
601612
do
602613
echo "INFO: Creating directory $nodeHome"
614+
# shellcheck disable=SC2086
603615
mkdir -p $nodeHome
604616
done
605617
fi
@@ -608,8 +620,9 @@ setup_host_prepreq(){
608620
echo "INFO: Starting chronyd service"
609621
systemctl start chronyd
610622
fi
611-
623+
# shellcheck disable=SC2002
612624
cat /sys/devices/system/clocksource/clocksource0/available_clocksource | grep tsc
625+
# shellcheck disable=SC2181
613626
if [ $? -eq 0 ]; then
614627
echo "INFO: Setting current clocksource"
615628
echo "tsc">/sys/devices/system/clocksource/clocksource0/current_clocksource
@@ -625,8 +638,9 @@ setup_host_prepreq(){
625638
# shellcheck disable=SC2006
626639
freeSHM=`df -h /dev/shm | tail -n +2 | awk '{ print $4 }'`
627640
echo "INFO: Available shm = [${freeSHM}]"
628-
# shellcheck disable=SC2006
641+
# shellcheck disable=SC2086,SC2060,SC2006
629642
freeSHM=`echo ${freeSHM} | tr -d [:alpha:]`
643+
# shellcheck disable=SC2129,SC2086
630644
if [ ${freeSHM} -lt 4 ]; then
631645
echo "ERROR: Low free space [${freeSHM}] in /dev/shm. Need at least 4GB space. Exiting."
632646
DisplayUsage

0 commit comments

Comments
 (0)