This commit is contained in:
Cezar Lungu 2024-11-29 03:19:25 +00:00 committed by GitHub
commit 09e7a064d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1110,11 +1110,10 @@ 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\$")
CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -c -E "^V.*/CN=$CLIENT\$")
if [[ $CLIENTEXISTS == '1' ]]; then
echo ""
echo "The specified client CN was already found in easy-rsa, please choose another name."
exit
echo "The specified client CN was already found in easy-rsa."
else
cd /etc/openvpn/easy-rsa/ || return
case $PASS in