From 1c5b053fe21d753959fa16531fcb69135ad105b4 Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Tue, 3 Sep 2024 01:51:08 +0500 Subject: [PATCH] Added duplicate-cn in questions Added duplicate-cn in questions, so it will allow clients to connect using same .ovpn. --- openvpn-install.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openvpn-install.sh b/openvpn-install.sh index 6c6a647..a2b3226 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -356,6 +356,21 @@ function installQuestions() { fi done echo "" + echo "Do you want the same client ovpn to connect for multiple clients?" + echo " 1) Yes" + echo " 2) No" + until [[ $MULTI_CLIENT_CHOICE =~ ^[1-2]$ ]]; do + read -rp "Choice [1-2]: " -e -i 2 MULTI_CLIENT_CHOICE + done + case $MULTI_CLIENT_CHOICE in + 1) + MULTI_CLIENT="yes" + ;; + 2) + MULTI_CLIENT="no" + ;; + esac + echo "" echo "Do you want to use compression? It is not recommended since the VORACLE attack makes use of it." until [[ $COMPRESSION_ENABLED =~ (y|n) ]]; do read -rp"Enable compression? [y/n]: " -e -i n COMPRESSION_ENABLED @@ -775,6 +790,10 @@ function installOpenVPN() { echo "proto ${PROTOCOL}6" >>/etc/openvpn/server.conf fi + if [[ $MULTI_CLIENT == "yes" ]]; then + echo "duplicate-cn" >>/etc/openvpn/server.conf + fi + echo "dev tun user nobody group $NOGROUP