From 3c9580b5b4e2dabc789c92f3d15c8279d7d50be3 Mon Sep 17 00:00:00 2001 From: Joel Ramos <53574318+joelpramos@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:15:34 -0500 Subject: [PATCH] fix: allow reusing revoked client names (#1185) Close https://github.com/angristan/openvpn-install/pull/680, close https://github.com/angristan/openvpn-install/issues/652, close https://github.com/angristan/openvpn-install/issues/1024, close https://github.com/angristan/openvpn-install/issues/746 Co-authored-by: Stanislas --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 825d7b6..5e0eeaa 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -1510,8 +1510,8 @@ function newClient() { read -rp "Select an option [1-2]: " -e -i 1 PASS done - CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -c -E "/CN=$CLIENT\$") - if [[ $CLIENTEXISTS == '1' ]]; then + CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -E "^V" | grep -c -E "/CN=$CLIENT\$") + if [[ $CLIENTEXISTS != '0' ]]; then log_error "The specified client CN was already found in easy-rsa, please choose another name." exit else