From f6e5bb71f033940808847ff281de80df076a0a03 Mon Sep 17 00:00:00 2001
From: nsharief <nsharief94@gmail.com>
Date: Sat, 15 Jun 2024 18:51:12 +0100
Subject: [PATCH] Customer DNS option 7

---
 openvpn-install.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/openvpn-install.sh b/openvpn-install.sh
index 68a0bb0..8975618 100644
--- a/openvpn-install.sh
+++ b/openvpn-install.sh
@@ -196,6 +196,18 @@ if [[ ! -e /etc/openvpn/server/server.conf ]]; then
 		echo "$dns: invalid selection."
 		read -p "DNS server [1]: " dns
 	done
+  if [[ "$dns" == 7 ]]; then
+    read -p "Enter custom DNS server 1: " dns_custom_1
+    until [[ -z "$dns_custom_1" || "$dns_custom_1" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; do
+      echo "$dns_custom_1: invalid DNS server."
+      read -p "Enter custom DNS server 1: " dns_custom_1
+    done
+    read -p "Enter custom DNS server 2: " dns_custom_2
+    until [[ -z "$dns_custom_2" || "$dns_custom_2" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; do
+      echo "$dns_custom_2: invalid DNS server."
+      read -p "Enter custom DNS server 2: " dns_custom_2
+    done
+  fi  
 	echo
 	echo "Enter a name for the first client:"
 	read -p "Name [client]: " unsanitized_client