mirror of
https://github.com/pivpn/pivpn.git
synced 2025-04-25 08:40:10 +00:00
Added missing script folder
This commit is contained in:
parent
24a1a00d37
commit
5e16322f9e
15 changed files with 1681 additions and 0 deletions
27
scripts/openvpn/listOVPN.sh
Executable file
27
scripts/openvpn/listOVPN.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
# PiVPN: list clients script
|
||||
|
||||
INDEX="/etc/openvpn/easy-rsa/pki/index.txt"
|
||||
printf "\n"
|
||||
if [ ! -f "${INDEX}" ]; then
|
||||
echo "The file: $INDEX was not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf ": NOTE : The first entry should always be your valid server!\n"
|
||||
printf "\n"
|
||||
printf "\e[1m::: Certificate Status List :::\e[0m\n"
|
||||
printf " ::\e[4m Status \e[0m||\e[4m Name \e[0m:: \n"
|
||||
|
||||
while read -r line || [ -n "$line" ]; do
|
||||
STATUS=$(echo "$line" | awk '{print $1}')
|
||||
NAME=$(echo "$line" | sed -e 's:.*/CN=::')
|
||||
if [ "${STATUS}" == "V" ]; then
|
||||
printf " Valid :: %s\n" "$NAME"
|
||||
elif [ "${STATUS}" == "R" ]; then
|
||||
printf " Revoked :: %s\n" "$NAME"
|
||||
else
|
||||
printf " Unknown :: %s\n" "$NAME"
|
||||
fi
|
||||
done <${INDEX}
|
||||
printf "\n"
|
Loading…
Add table
Add a link
Reference in a new issue