mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-20 03:40:17 +00:00
fix clientSTAT.sh error if all clients are disabled
This commit is contained in:
parent
86de3eaa8c
commit
ec32851e0c
1 changed files with 19 additions and 19 deletions
|
@ -37,7 +37,7 @@ listClients(){
|
||||||
printf "\e[4mName\e[0m \t \e[4mRemote IP\e[0m \t \e[4mVirtual IP\e[0m \t \e[4mBytes Received\e[0m \t \e[4mBytes Sent\e[0m \t \e[4mLast Seen\e[0m\n"
|
printf "\e[4mName\e[0m \t \e[4mRemote IP\e[0m \t \e[4mVirtual IP\e[0m \t \e[4mBytes Received\e[0m \t \e[4mBytes Sent\e[0m \t \e[4mLast Seen\e[0m\n"
|
||||||
|
|
||||||
while IFS= read -r LINE; do
|
while IFS= read -r LINE; do
|
||||||
|
if [ -n "${LINE}" ]; then
|
||||||
PUBLIC_KEY="$(awk '{ print $1 }' <<< "$LINE")"
|
PUBLIC_KEY="$(awk '{ print $1 }' <<< "$LINE")"
|
||||||
REMOTE_IP="$(awk '{ print $3 }' <<< "$LINE")"
|
REMOTE_IP="$(awk '{ print $3 }' <<< "$LINE")"
|
||||||
VIRTUAL_IP="$(awk '{ print $4 }' <<< "$LINE")"
|
VIRTUAL_IP="$(awk '{ print $4 }' <<< "$LINE")"
|
||||||
|
@ -58,7 +58,7 @@ listClients(){
|
||||||
printf "%s \t %s \t %s \t %'d \t %'d \t %s\n" "$CLIENT_NAME" "$REMOTE_IP" "${VIRTUAL_IP/\/32/}" "$BYTES_RECEIVED" "$BYTES_SENT" "(not yet)"
|
printf "%s \t %s \t %s \t %'d \t %'d \t %s\n" "$CLIENT_NAME" "$REMOTE_IP" "${VIRTUAL_IP/\/32/}" "$BYTES_RECEIVED" "$BYTES_SENT" "(not yet)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done <<< "$DUMP"
|
done <<< "$DUMP"
|
||||||
|
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
|
Loading…
Reference in a new issue