mirror of
https://github.com/hwdsl2/wireguard-install.git
synced 2024-09-22 00:00:55 +02:00
Improve listing clients
- When listing existing clients, show total and improve output.
This commit is contained in:
parent
516ff9271e
commit
3e57822d27
|
@ -617,7 +617,12 @@ else
|
|||
exit
|
||||
fi
|
||||
echo
|
||||
grep '^# BEGIN_PEER' /etc/wireguard/wg0.conf | cut -d ' ' -f 3
|
||||
grep '^# BEGIN_PEER' /etc/wireguard/wg0.conf | cut -d ' ' -f 3 | nl -s ') '
|
||||
if [ "$number_of_clients" = 1 ]; then
|
||||
printf '\n%s\n' "Total: 1 client"
|
||||
elif [ -n "$number_of_clients" ]; then
|
||||
printf '\n%s\n' "Total: $number_of_clients clients"
|
||||
fi
|
||||
;;
|
||||
3)
|
||||
number_of_clients=$(grep -c '^# BEGIN_PEER' /etc/wireguard/wg0.conf)
|
||||
|
|
Loading…
Reference in New Issue
Block a user