diff --git a/openvpn-install.sh b/openvpn-install.sh index 36b64d1..eddaebc 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -1241,34 +1241,7 @@ function listcerts () { # Modified Script to add Certificate expiration Date -- Swamy Goundar 03/28/2020 -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[4mStatus\e[0m :: \e[4mName\e[0m\e[0m :: \e[4mExpiration \e[0m\n" - -while read -r line || [ -n "$line" ]; do - STATUS=$(echo "$line" | awk '{print $1}') - NAME=$(echo "$line" | sed -e 's:.*/CN=::') - EXPD=$(echo "$line" | awk '{if (length($2) == 15) print $2; else print "20"$2}' | cut -b 1-8 | date +"%b %d %Y" -f -) - - if [ "${STATUS}" == "V" ]; then - printf " Valid :: $NAME :: $EXPD \n" - - elif [ "${STATUS}" == "R" ]; then - printf " Revoked :: $NAME :: $EXPD \n" - else - printf " Unknown :: $NAME :: $EXPD \n" - - fi -done <${INDEX} | column -t -printf "\n" }