Skip to content

Commit 3c9580b

Browse files
fix: allow reusing revoked client names (#1185)
Close #680, close #652, close #1024, close #746 Co-authored-by: Stanislas <git@slange.me>
1 parent 65f4885 commit 3c9580b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openvpn-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,8 +1510,8 @@ function newClient() {
15101510
read -rp "Select an option [1-2]: " -e -i 1 PASS
15111511
done
15121512

1513-
CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -c -E "/CN=$CLIENT\$")
1514-
if [[ $CLIENTEXISTS == '1' ]]; then
1513+
CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -E "^V" | grep -c -E "/CN=$CLIENT\$")
1514+
if [[ $CLIENTEXISTS != '0' ]]; then
15151515
log_error "The specified client CN was already found in easy-rsa, please choose another name."
15161516
exit
15171517
else

0 commit comments

Comments
 (0)