fixes for shell script errors detected by shellcheck --severity=error.

pull/4938/head
Daniel Pouzzner 2022-03-08 12:51:48 -06:00
parent a4229c6cf8
commit c9a7393923
18 changed files with 41 additions and 25 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
if [ -z $1 ]; then if [ -z $1 ]; then
echo "./build <Debug | Release>" echo "./build <Debug | Release>"
exit -1 exit 1
fi fi
printf "Erasing previous hexagon_$1_dynamic_toolv83_v65 and UbuntuARM_$1_aarch64\n" printf "Erasing previous hexagon_$1_dynamic_toolv83_v65 and UbuntuARM_$1_aarch64\n"

View File

@ -1,3 +1,5 @@
#!/bin/sh
# Place CMakeList in needed directories # Place CMakeList in needed directories
cp CMakeLists_wolfSSL.txt ../../CMakeLists.txt cp CMakeLists_wolfSSL.txt ../../CMakeLists.txt

View File

@ -1,3 +1,5 @@
#!/bin/sh
########################################################### ###########################################################
########## update and sign server-revoked-key.pem ################ ########## update and sign server-revoked-key.pem ################
########################################################### ###########################################################

View File

@ -54,13 +54,16 @@ build_test_cert_conf() {
echo "" >> "$1".conf echo "" >> "$1".conf
if [ -n "$3" ]; then if [ -n "$3" ]; then
echo "[ req_ext ]" >> "$1".conf echo "[ req_ext ]" >> "$1".conf
if [ "$3" != *"DER"* ]; then case "$3" in
echo "subjectAltName = @alt_names" >> "$1".conf *DER*)
echo "[alt_names]" >> "$1".conf echo "subjectAltName = $3" >> "$1".conf
echo "DNS.1 = $3" >> "$1".conf ;;
else *)
echo "subjectAltName = $3" >> "$1".conf echo "subjectAltName = @alt_names" >> "$1".conf
fi echo "[alt_names]" >> "$1".conf
echo "DNS.1 = $3" >> "$1".conf
;;
esac
fi fi
} }

View File

@ -34,7 +34,7 @@ fi
# Checking arguments and setting appropriate option variables # Checking arguments and setting appropriate option variables
for var in $@ for var in "$@"
do do
case $var in case $var in
-install) -install)

View File

@ -43,7 +43,7 @@ do_cleanup() {
do_trap() { do_trap() {
echo "got trap" echo "got trap"
do_cleanup do_cleanup
exit -1 exit 1
} }
trap do_trap INT TERM trap do_trap INT TERM

View File

@ -230,7 +230,7 @@ openssl ocsp -port $port1 -nmin 1 \
-rsigner certs/ocsp/intermediate1-ca-cert.pem \ -rsigner certs/ocsp/intermediate1-ca-cert.pem \
-rkey certs/ocsp/intermediate1-ca-key.pem \ -rkey certs/ocsp/intermediate1-ca-key.pem \
-CA certs/ocsp/intermediate1-ca-cert.pem \ -CA certs/ocsp/intermediate1-ca-cert.pem \
$@ \ "$@" \
& &
sleep 0.1 sleep 0.1

View File

@ -296,34 +296,34 @@ sleep 0.1
# OLD: ./certs/ocsp/ocspd-root-ca-and-intermediate-cas.sh & # OLD: ./certs/ocsp/ocspd-root-ca-and-intermediate-cas.sh &
# NEW: openssl isn't being cleaned up, invoke directly in script for cleanup # NEW: openssl isn't being cleaned up, invoke directly in script for cleanup
# purposes! # purposes!
openssl ocsp -port $port1 -nmin 1 \ openssl ocsp -port $port1 -nmin 1 \
-index certs/ocsp/index-ca-and-intermediate-cas.txt \ -index certs/ocsp/index-ca-and-intermediate-cas.txt \
-rsigner certs/ocsp/ocsp-responder-cert.pem \ -rsigner certs/ocsp/ocsp-responder-cert.pem \
-rkey certs/ocsp/ocsp-responder-key.pem \ -rkey certs/ocsp/ocsp-responder-key.pem \
-CA certs/ocsp/root-ca-cert.pem \ -CA certs/ocsp/root-ca-cert.pem \
$@ \ "$@" \
& &
# OLD: ./certs/ocsp/ocspd-intermediate2-ca-issued-certs.sh & # OLD: ./certs/ocsp/ocspd-intermediate2-ca-issued-certs.sh &
# NEW: openssl isn't being cleaned up, invoke directly in script for cleanup # NEW: openssl isn't being cleaned up, invoke directly in script for cleanup
# purposes! # purposes!
openssl ocsp -port $port2 -nmin 1 \ openssl ocsp -port $port2 -nmin 1 \
-index certs/ocsp/index-intermediate2-ca-issued-certs.txt \ -index certs/ocsp/index-intermediate2-ca-issued-certs.txt \
-rsigner certs/ocsp/ocsp-responder-cert.pem \ -rsigner certs/ocsp/ocsp-responder-cert.pem \
-rkey certs/ocsp/ocsp-responder-key.pem \ -rkey certs/ocsp/ocsp-responder-key.pem \
-CA certs/ocsp/intermediate2-ca-cert.pem \ -CA certs/ocsp/intermediate2-ca-cert.pem \
$@ \ "$@" \
& &
# OLD: ./certs/ocsp/ocspd-intermediate3-ca-issued-certs.sh & # OLD: ./certs/ocsp/ocspd-intermediate3-ca-issued-certs.sh &
# NEW: openssl isn't being cleaned up, invoke directly in script for cleanup # NEW: openssl isn't being cleaned up, invoke directly in script for cleanup
# purposes! # purposes!
openssl ocsp -port $port3 -nmin 1 \ openssl ocsp -port $port3 -nmin 1 \
-index certs/ocsp/index-intermediate3-ca-issued-certs.txt \ -index certs/ocsp/index-intermediate3-ca-issued-certs.txt \
-rsigner certs/ocsp/ocsp-responder-cert.pem \ -rsigner certs/ocsp/ocsp-responder-cert.pem \
-rkey certs/ocsp/ocsp-responder-key.pem \ -rkey certs/ocsp/ocsp-responder-key.pem \
-CA certs/ocsp/intermediate3-ca-cert.pem \ -CA certs/ocsp/intermediate3-ca-cert.pem \
$@ \ "$@" \
& &
sleep 0.1 sleep 0.1

View File

@ -407,11 +407,12 @@ command -v $OPENSSL >/dev/null 2>&1 || { echo >&2 "Requires openssl command, but
echo -e "\nTesting for _build directory as part of distcheck, different paths" echo -e "\nTesting for _build directory as part of distcheck, different paths"
currentDir=`pwd` currentDir=`pwd`
if [ "$currentDir" = *"_build" ] case "$currentDir" in
then *_build)
echo -e "_build directory detected, moving a directory back" echo -e "_build directory detected, moving a directory back"
cd .. cd ..
fi ;;
esac
echo -e "\nChecking for wolfSSL client - needed for cipher list" echo -e "\nChecking for wolfSSL client - needed for cipher list"
wolfssl_client_avail=`$WOLFSSL_CLIENT -?` wolfssl_client_avail=`$WOLFSSL_CLIENT -?`
case $wolfssl_client_avail in case $wolfssl_client_avail in

View File

@ -120,7 +120,7 @@ check_dtls_srtp() {
echo -n "check dtls $1 $2... " echo -n "check dtls $1 $2... "
if [ $check_ret -ne 0 ];then if [ $check_ret -ne 0 ];then
echo "failed" echo "failed"
exit -1 exit 1
else else
echo "ok" echo "ok"
fi fi

View File

@ -69,7 +69,7 @@ do_cleanup() {
do_trap() { do_trap() {
echo "got trap" echo "got trap"
do_cleanup do_cleanup
exit -1 exit 1
} }
trap do_trap INT TERM trap do_trap INT TERM

View File

@ -50,7 +50,7 @@ do_cleanup() {
do_trap() { do_trap() {
echo "got trap" echo "got trap"
do_cleanup do_cleanup
exit -1 exit 1
} }
do_test() { do_test() {

View File

@ -90,7 +90,7 @@ do_cleanup() {
do_trap() { do_trap() {
echo "got trap" echo "got trap"
do_cleanup do_cleanup
exit -1 exit 1
} }
trap do_trap INT TERM trap do_trap INT TERM

View File

@ -80,7 +80,7 @@ do_cleanup() {
do_trap() { do_trap() {
echo "got trap" echo "got trap"
do_cleanup do_cleanup
exit -1 exit 1
} }
trap do_trap INT TERM trap do_trap INT TERM

View File

@ -1,3 +1,5 @@
#!/bin/sh
[ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm

View File

@ -1,3 +1,5 @@
#!/bin/sh
[ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1
apt-get update apt-get update

View File

@ -1,3 +1,5 @@
#!/bin/sh
[ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1
rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

View File

@ -1,3 +1,5 @@
#!/bin/sh
[ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1 [ "$(whoami)" != "root" ] && echo "Sorry, you are not root." && exit 1
apt-get update apt-get update