mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-12-15 16:37:03 +01:00
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 <git@slange.me>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user