From 12de079a8ca59e6df6022c761835271346fe5751 Mon Sep 17 00:00:00 2001 From: 4s3ti <4s3ti@protonmail.com> Date: Wed, 3 Nov 2021 02:00:20 +0100 Subject: [PATCH] Shellcheck compliance scripts/openvpn/clientStats.sh * fix SC2086: Double quote to prevent globbing and word splitting. * Added missing double quotes --- scripts/openvpn/clientStat.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/openvpn/clientStat.sh b/scripts/openvpn/clientStat.sh index 4737d7f..82809f4 100755 --- a/scripts/openvpn/clientStat.sh +++ b/scripts/openvpn/clientStat.sh @@ -37,15 +37,15 @@ listClients(){ if [ -n "$(type -t numfmt)" ]; then if [ "$HR" = 1 ]; then while read -r line; do - read -r -a array <<< $line + read -r -a array <<< "$line" [[ ${array[0]} = CLIENT_LIST ]] || continue - printf "%s \t %s \t %s \t %s \t %s \t %s %s %s - %s\n" ${array[1]} ${array[2]} ${array[3]} $(hr ${array[4]}) $(hr ${array[5]}) ${array[7]} ${array[8]} ${array[10]} ${array[9]} + printf "%s \t %s \t %s \t %s \t %s \t %s %s %s - %s\n" "${array[1]}" "${array[2]}" "${array[3]}" "$(hr "${array[4]}")" "$(hr "${array[5]}")" "${array[7]}" "${array[8]}" "${array[10]}" "${array[9]}" done <$STATUS_LOG else while read -r line; do - read -r -a array <<< $line + read -r -a array <<< "$line" [[ ${array[0]} = CLIENT_LIST ]] || continue - printf "%s \t %s \t %s \t %'d \t %'d \t %s %s %s - %s\n" ${array[1]} ${array[2]} ${array[3]} ${array[4]} ${array[5]} ${array[7]} ${array[8]} ${array[10]} ${array[9]} + printf "%s \t %s \t %s \t %'d \t %'d \t %s %s %s - %s\n" "${array[1]}" "${array[2]}" "${array[3]}" "${array[4]}" "${array[5]}" "${array[7]}" "${array[8]}" "${array[10]}" "${array[9]}" done <$STATUS_LOG fi else