From 5e090770c8b9803926417389bfbd156c0b46e41d Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sun, 12 Jul 2020 17:14:30 -0500 Subject: [PATCH] Update IKEv2 script - Allow specifying custom DNS servers - Add notes about the IKEv2 MOBIKE extension - Cleanup --- extras/ikev2setup.sh | 82 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/extras/ikev2setup.sh b/extras/ikev2setup.sh index 92d289b..38d6824 100644 --- a/extras/ikev2setup.sh +++ b/extras/ikev2setup.sh @@ -189,7 +189,7 @@ else fi fi -cat <> /etc/ipsec.d/ikev2.conf <<'EOF' - modecfgdns="8.8.8.8 8.8.4.4" - encapsulation=yes + if [ -n "$dns_server_2" ]; then +cat >> /etc/ipsec.d/ikev2.conf <> /etc/ipsec.d/ikev2.conf <> /etc/ipsec.d/ikev2.conf else @@ -464,11 +514,16 @@ EOF fi ;; 3.19|3.2[012]) -cat >> /etc/ipsec.d/ikev2.conf <<'EOF' - modecfgdns1=8.8.8.8 - modecfgdns2=8.8.4.4 - encapsulation=yes + if [ -n "$dns_server_2" ]; then +cat >> /etc/ipsec.d/ikev2.conf <> /etc/ipsec.d/ikev2.conf <