Added PiVPN Function listcerts
This commit is contained in:
parent
09a912337d
commit
671e21de3c
1 changed files with 33 additions and 0 deletions
|
|
@ -1230,6 +1230,39 @@ function removeOpenVPN () {
|
|||
fi
|
||||
}
|
||||
|
||||
function listcerts () {
|
||||
# PiVPN: list clients script function
|
||||
|
||||
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"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
function manageMenu () {
|
||||
clear
|
||||
echo "Welcome to OpenVPN-install!"
|
||||
|
|
|
|||
Loading…
Reference in a new issue