mirror of
https://github.com/hwdsl2/openvpn-install.git
synced 2026-01-10 18:36:17 +00:00
Improve listing clients
- When listing existing clients, show total and improve output.
This commit is contained in:
@@ -689,7 +689,12 @@ else
|
||||
exit
|
||||
fi
|
||||
echo
|
||||
tail -n +2 /etc/openvpn/server/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2
|
||||
tail -n +2 /etc/openvpn/server/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | 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
|
||||
;;
|
||||
4)
|
||||
number_of_clients=$(tail -n +2 /etc/openvpn/server/easy-rsa/pki/index.txt | grep -c "^V")
|
||||
|
||||
Reference in New Issue
Block a user