From ae6e832873e140597aa56b602201312f94a033c0 Mon Sep 17 00:00:00 2001 From: hadish777 <69632310+hadish777@users.noreply.github.com> Date: Thu, 13 Aug 2020 16:32:00 +0430 Subject: [PATCH] Update openvpn-install.sh --- openvpn-install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 685f607..a12a4ad 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -703,12 +703,12 @@ function installOpenVPN() { esac # Generate a random, alphanumeric identifier of 16 characters for CN and one for server name - SERVER_CN="cn_$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)" - echo "$SERVER_CN" >SERVER_CN_GENERATED + SERVER_CON="con_$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)" + echo "$SERVER_CON" >SERVER_CON_GENERATED SERVER_NAME="server_$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)" echo "$SERVER_NAME" >SERVER_NAME_GENERATED - echo "set_var EASYRSA_REQ_CN $SERVER_CN" >>vars + echo "set_var EASYRSA_REQ_CON $SERVER_CON" >>vars # Create the PKI, set up the CA, the DH params and the server certificate ./easyrsa init-pki @@ -1061,7 +1061,7 @@ 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 "/CON=$CLIENT\$") if [[ $CLIENTEXISTS == '1' ]]; then echo "" echo "The specified client CN was already found in easy-rsa, please choose another name."