From bb05d33ad934703fe8afee9477c439ce8b523e03 Mon Sep 17 00:00:00 2001 From: Michael Adams Date: Tue, 23 Feb 2021 04:00:40 -0800 Subject: [PATCH] bootstrap: shellcheck audit; closes #71 --- bootstrap/opnsense-bootstrap.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap/opnsense-bootstrap.sh b/bootstrap/opnsense-bootstrap.sh index e8a0778..3863cff 100755 --- a/bootstrap/opnsense-bootstrap.sh +++ b/bootstrap/opnsense-bootstrap.sh @@ -63,7 +63,7 @@ while getopts a:bfin:r:t:vy OPT; do TYPE=${OPTARG} ;; v) - echo ${RELEASE} + echo "${RELEASE}" exit 0 ;; y) @@ -76,7 +76,7 @@ while getopts a:bfin:r:t:vy OPT; do esac done -shift $((${OPTIND} - 1)) +shift $((OPTIND - 1)) if [ "$(id -u)" != "0" ]; then echo "Must be root." >&2 @@ -156,7 +156,7 @@ echo rm -rf /usr/local/etc/pkg -rm -rf ${WORKDIR}/* +rm -rf "${WORKDIR:?}"/* mkdir -p ${WORKDIR} export ASSUME_ALWAYS_YES=yes @@ -192,7 +192,7 @@ if [ -z "${DO_BARE}" ]; then fi make -C ${WORKDIR}/core-${SUBDIR} bootstrap DESTDIR= \ - CORE_ABI=${DO_ABI#"-a "} CORE_FLAVOUR=${FLAVOUR} + CORE_ABI="${DO_ABI#"-a "}" CORE_FLAVOUR="${FLAVOUR}" if [ -z "${DO_BARE}" ]; then if [ -n "${DO_FACTORY}" ]; then @@ -200,7 +200,7 @@ if [ -z "${DO_BARE}" ]; then fi pkg bootstrap - pkg install ${TYPE} + pkg install "${TYPE}" # beyond this point verify everything unset SSL_NO_VERIFY_PEER