diff --git a/scripts/openvpn/listOVPN.sh b/scripts/openvpn/listOVPN.sh index c87ecfd..cd02790 100755 --- a/scripts/openvpn/listOVPN.sh +++ b/scripts/openvpn/listOVPN.sh @@ -8,6 +8,14 @@ if [ ! -f "${INDEX}" ]; then exit 1 fi +EASYRSA="/etc/openvpn/easy-rsa/easyrsa" +if [ ! -f "${EASYRSA}" ]; then + echo "The file: $EASYRSA was not found!" + exit 1 +fi + +$EASYRSA update-db >> /dev/null 2>1 + printf ": NOTE : The first entry should always be your valid server!\n" printf "\\n" printf "\\e[1m::: Certificate Status List :::\\e[0m\\n" @@ -23,6 +31,8 @@ while read -r line || [ -n "$line" ]; do printf "Valid \t %s \t %s\\n" "$NAME" "$EXPD" elif [ "${STATUS}" == "R" ]; then printf "Revoked \t %s \t %s\\n" "$NAME" "$EXPD" + elif [ "${STATUS}" == "E" ]; then + printf "Expired \t %s \t %s\\n" "$NAME" "$EXPD" else printf "Unknown \t %s \t %s\\n" "$NAME" "$EXPD" fi