mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-24 05:56:08 +03:00
Added capability to set custom DNS server
This commit is contained in:
parent
6e63867b6b
commit
55c2ebded6
@ -190,10 +190,23 @@ if [[ ! -e /etc/openvpn/server/server.conf ]]; then
|
|||||||
echo " 5) Quad9"
|
echo " 5) Quad9"
|
||||||
echo " 6) AdGuard"
|
echo " 6) AdGuard"
|
||||||
read -p "DNS server [1]: " dns
|
read -p "DNS server [1]: " dns
|
||||||
until [[ -z "$dns" || "$dns" =~ ^[1-6]$ ]]; do
|
until [[ -z "$dns" || "$dns" =~ ^[1-7]$ ]]; do
|
||||||
echo "$dns: invalid selection."
|
echo "$dns: invalid selection."
|
||||||
read -p "DNS server [1]: " dns
|
read -p "DNS server [1]: " dns
|
||||||
done
|
done
|
||||||
|
if [[ "$dns" == 7 ]]; then
|
||||||
|
read -p "Enter custom DNS server 1: " dns_custom_1
|
||||||
|
until [[ "$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 [[ "$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
|
||||||
|
|
||||||
case "$dns" in
|
case "$dns" in
|
||||||
1|"")
|
1|"")
|
||||||
resolver='the current system resolvers'
|
resolver='the current system resolvers'
|
||||||
|
Loading…
Reference in New Issue
Block a user