From 1c5b053fe21d753959fa16531fcb69135ad105b4 Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Tue, 3 Sep 2024 01:51:08 +0500 Subject: [PATCH 1/7] 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 From 11caaf0ec6cc742fdcacdfa1314476a3cb0bdcde Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Tue, 3 Sep 2024 02:00:24 +0500 Subject: [PATCH 2/7] Update openvpn-install.sh --- openvpn-install.sh | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index a2b3226..7120b06 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -356,20 +356,13 @@ 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 "Do you want the same client .ovpn file to connect multiple clients? (This will add 'duplicate-cn' in the server.conf) [y/n]: " + + if [[ $MULTI_CLIENT_CHOICE =~ ^[Yy]$ ]]; then + MULTI_CLIENT="y" + else + MULTI_CLIENT="n" + fi 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 @@ -790,8 +783,8 @@ function installOpenVPN() { echo "proto ${PROTOCOL}6" >>/etc/openvpn/server.conf fi - if [[ $MULTI_CLIENT == "yes" ]]; then - echo "duplicate-cn" >>/etc/openvpn/server.conf + if [[ $MULTI_CLIENT == "y" ]]; then + echo "-cn" >>/etc/openvpn/server.conf fi echo "dev tun From 3fa51ae0dc5a1a19df908cac206073878dcf8081 Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Tue, 3 Sep 2024 02:04:22 +0500 Subject: [PATCH 3/7] Update openvpn-install.sh --- openvpn-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 7120b06..b04c981 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -356,9 +356,9 @@ function installQuestions() { fi done echo "" - echo "Do you want the same client .ovpn file to connect multiple clients? (This will add 'duplicate-cn' in the server.conf) [y/n]: " + read -rp "Do you want the same client .ovpn file to connect multiple clients? (This will add 'duplicate-cn' in the server.conf) [y/n]: " -e -i n MULTI_CLIENT_CHOICE - if [[ $MULTI_CLIENT_CHOICE =~ ^[Yy]$ ]]; then + if [[ $MULTI_CLIENT_CHOICE =~ ^[Yy]$ ]]; then MULTI_CLIENT="y" else MULTI_CLIENT="n" From 38d39b254a3fda61c23901eb35e20d70ff0f9c0a Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Tue, 3 Sep 2024 02:08:36 +0500 Subject: [PATCH 4/7] Update openvpn-install.sh --- openvpn-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index b04c981..a5df23e 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -784,7 +784,7 @@ function installOpenVPN() { fi if [[ $MULTI_CLIENT == "y" ]]; then - echo "-cn" >>/etc/openvpn/server.conf + echo "duplicate-cn" >>/etc/openvpn/server.conf fi echo "dev tun From e144a93ae6501b80a342523f45aa5ef4f417a4db Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Mon, 20 Jan 2025 23:46:29 +0500 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e670650..deed86e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ graph LR First, get the script and make it executable: ```bash -curl -O https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh +curl -O https://raw.githubusercontent.com/Shahzainali/openvpn-install/refs/heads/master/openvpn-install.sh chmod +x openvpn-install.sh ``` From 6f1ef9325d7c0079f9552d527a4b18fcbdb52ac5 Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Thu, 23 Jan 2025 17:46:57 +0500 Subject: [PATCH 6/7] fixed -> Wrong indentation type(spaces instead of tabs) --- openvpn-install.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 566f848..81945ad 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -399,11 +399,10 @@ function installQuestions() { done echo "" read -rp "Do you want the same client .ovpn file to connect multiple clients? (This will add 'duplicate-cn' in the server.conf) [y/n]: " -e -i n MULTI_CLIENT_CHOICE - if [[ $MULTI_CLIENT_CHOICE =~ ^[Yy]$ ]]; then - MULTI_CLIENT="y" + MULTI_CLIENT="y" else - MULTI_CLIENT="n" + MULTI_CLIENT="n" fi echo "" echo "Do you want to use compression? It is not recommended since the VORACLE attack makes use of it." @@ -416,7 +415,7 @@ function installQuestions() { echo " 2) LZ4" echo " 3) LZ0" until [[ $COMPRESSION_CHOICE =~ ^[1-3]$ ]]; do - read -rp"Compression algorithm [1-3]: " -e -i 1 COMPRESSION_CHOICE + read -rp"Compression algorithm [1-3]: " -e -i 1 COMPRESSION_CHOICE done case $COMPRESSION_CHOICE in 1) @@ -817,8 +816,8 @@ function installOpenVPN() { echo "proto ${PROTOCOL}6" >>/etc/openvpn/server.conf fi - if [[ $MULTI_CLIENT == "y" ]]; then - echo "duplicate-cn" >>/etc/openvpn/server.conf + if [[ $MULTI_CLIENT == "y" ]]; then + echo "duplicate-cn" >>/etc/openvpn/server.conf fi echo "dev tun From 30b7525debece728db4dbb0dce7ccb64913145c7 Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Thu, 23 Jan 2025 17:53:05 +0500 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index deed86e..e670650 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ graph LR First, get the script and make it executable: ```bash -curl -O https://raw.githubusercontent.com/Shahzainali/openvpn-install/refs/heads/master/openvpn-install.sh +curl -O https://raw.githubusercontent.com/angristan/openvpn-install/master/openvpn-install.sh chmod +x openvpn-install.sh ```