Shellcheck compliance

scripts/openvpn/clientStats.sh
  * fix SC2086: Double quote to prevent globbing and word splitting.
  * Added missing double quotes
This commit is contained in:
4s3ti 2021-11-03 02:00:20 +01:00
parent b4e9831da3
commit 12de079a8c

View file

@ -37,15 +37,15 @@ listClients(){
if [ -n "$(type -t numfmt)" ]; then if [ -n "$(type -t numfmt)" ]; then
if [ "$HR" = 1 ]; then if [ "$HR" = 1 ]; then
while read -r line; do while read -r line; do
read -r -a array <<< $line read -r -a array <<< "$line"
[[ ${array[0]} = CLIENT_LIST ]] || continue [[ ${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 done <$STATUS_LOG
else else
while read -r line; do while read -r line; do
read -r -a array <<< $line read -r -a array <<< "$line"
[[ ${array[0]} = CLIENT_LIST ]] || continue [[ ${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 done <$STATUS_LOG
fi fi
else else