From 96e6ea71e9094c3b5bce52489e4f8262bb14b16c Mon Sep 17 00:00:00 2001 From: Stanislas Lange Date: Mon, 27 Apr 2020 17:45:58 +0200 Subject: [PATCH] fix(newClient): exit if client name already taken fix #613 --- openvpn-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 2f9972f..27bb1c1 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -1059,7 +1059,8 @@ function newClient() { CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -c -E "/CN=$CLIENT\$") if [[ $CLIENTEXISTS == '1' ]]; then echo "" - echo "The specified client CN was found in easy-rsa." + echo "The specified client CN was already found in easy-rsa, please choose another name." + exit else cd /etc/openvpn/easy-rsa/ || return case $PASS in