From e6933e6c53d9a1502520440462c12ec0eeb4d14c Mon Sep 17 00:00:00 2001 From: 4s3ti <4s3ti@protonmail.com> Date: Wed, 3 Nov 2021 18:07:19 +0100 Subject: [PATCH] Shellcheck compliance scripts/wireguard/pivpnDEBUG.sh * SC1090: ShellCheck can't follow non-constant source. Use a directive to specify location. * Disabled warning * SC2154: is referenced but not assigned. * Disabled warning * SC2086: Double quote to prevent globbing and word splitting. * Added double quotes --- scripts/wireguard/pivpnDEBUG.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/wireguard/pivpnDEBUG.sh b/scripts/wireguard/pivpnDEBUG.sh index 2844df1..b7f8f73 100755 --- a/scripts/wireguard/pivpnDEBUG.sh +++ b/scripts/wireguard/pivpnDEBUG.sh @@ -8,6 +8,7 @@ if [ ! -f "${setupVars}" ]; then exit 1 fi +# shellcheck disable=SC1090 source "${setupVars}" echo -e "::::\t\t\e[4mPiVPN debug\e[0m\t\t ::::" @@ -18,6 +19,8 @@ git --git-dir /usr/local/src/pivpn/.git rev-parse --abbrev-ref HEAD git --git-dir /usr/local/src/pivpn/.git log -n 1 --format='Commit: %H%nAuthor: %an%nDate: %ad%nSummary: %s' printf "=============================================\n" echo -e "::::\t \e[4mInstallation settings\e[0m \t ::::" +# Disabling SC2154 warning, variable is sourced externaly and may vary +# shellcheck disable=SC2154 sed "s/$pivpnHOST/REDACTED/" < ${setupVars} printf "=============================================\n" echo -e ":::: \e[4mServer configuration shown below\e[0m ::::" @@ -48,7 +51,7 @@ echo -e ":::: \t\e[4mRecursive list of files in\e[0m\t ::::\n::::\e\t[4m/etc/wir ls -LR /etc/wireguard printf "=============================================\n" echo -e "::::\t\t\e[4mSelf check\e[0m\t\t ::::" -/opt/pivpn/self_check.sh ${VPN} +/opt/pivpn/self_check.sh "${VPN}" printf "=============================================\n" echo -e ":::: Having trouble connecting? Take a look at the FAQ:" echo -e ":::: \e[1mhttps://docs.pivpn.io/faq\e[0m"