From 5c26782925e981012c763208de31a9a58b0193cc Mon Sep 17 00:00:00 2001 From: Ludwig Lautenbacher Date: Thu, 10 Sep 2020 14:55:35 +0200 Subject: [PATCH 1/4] Showing expired certificates as such. --- scripts/openvpn/listOVPN.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/openvpn/listOVPN.sh b/scripts/openvpn/listOVPN.sh index c87ecfd..55826c6 100755 --- a/scripts/openvpn/listOVPN.sh +++ b/scripts/openvpn/listOVPN.sh @@ -8,6 +8,8 @@ if [ ! -f "${INDEX}" ]; then exit 1 fi +/etc/openvpn/easy-rsa/easyrsa update-db >> /var/log/easyrsa_update-db.log 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 +25,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 :: %s\n" "$NAME" else printf "Unknown \t %s \t %s\\n" "$NAME" "$EXPD" fi From 0fb22bd15f1ecf378ca7fae8cd173f422757ac57 Mon Sep 17 00:00:00 2001 From: Ludwig Lautenbacher Date: Thu, 1 Oct 2020 13:23:31 +0200 Subject: [PATCH 2/4] dump easyrsa output to /dev/null --- scripts/openvpn/listOVPN.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/openvpn/listOVPN.sh b/scripts/openvpn/listOVPN.sh index 55826c6..5b2f401 100755 --- a/scripts/openvpn/listOVPN.sh +++ b/scripts/openvpn/listOVPN.sh @@ -8,7 +8,13 @@ if [ ! -f "${INDEX}" ]; then exit 1 fi -/etc/openvpn/easy-rsa/easyrsa update-db >> /var/log/easyrsa_update-db.log 2>1 +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" From 66536272be89a2b296adf36697becfb1ed78be91 Mon Sep 17 00:00:00 2001 From: Ludwig Lautenbacher Date: Thu, 1 Oct 2020 13:24:02 +0200 Subject: [PATCH 3/4] clean up formattting of Expired certificates --- scripts/openvpn/listOVPN.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/openvpn/listOVPN.sh b/scripts/openvpn/listOVPN.sh index 5b2f401..75b6b09 100755 --- a/scripts/openvpn/listOVPN.sh +++ b/scripts/openvpn/listOVPN.sh @@ -32,7 +32,7 @@ while read -r line || [ -n "$line" ]; do elif [ "${STATUS}" == "R" ]; then printf "Revoked \t %s \t %s\\n" "$NAME" "$EXPD" elif [ "${STATUS}" == "E" ]; then - printf " Expired :: %s\n" "$NAME" + printf "Expired :: %s\n" "$NAME" else printf "Unknown \t %s \t %s\\n" "$NAME" "$EXPD" fi From 1cc66efba6684b87deb6e976b8f5f5e28452ba24 Mon Sep 17 00:00:00 2001 From: Ludwig Lautenbacher Date: Thu, 1 Oct 2020 13:40:49 +0200 Subject: [PATCH 4/4] fixed formatting --- scripts/openvpn/listOVPN.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/openvpn/listOVPN.sh b/scripts/openvpn/listOVPN.sh index 75b6b09..cd02790 100755 --- a/scripts/openvpn/listOVPN.sh +++ b/scripts/openvpn/listOVPN.sh @@ -32,7 +32,7 @@ while read -r line || [ -n "$line" ]; do elif [ "${STATUS}" == "R" ]; then printf "Revoked \t %s \t %s\\n" "$NAME" "$EXPD" elif [ "${STATUS}" == "E" ]; then - printf "Expired :: %s\n" "$NAME" + printf "Expired \t %s \t %s\\n" "$NAME" "$EXPD" else printf "Unknown \t %s \t %s\\n" "$NAME" "$EXPD" fi