[PATCH] Make it easy to decline resolv.conf updates

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Feb 21 16:49:42 PST 2018


There are situations where the user wants to use the routing
information offered by the VPN, but does not want to use the DNS
recommendations.

In this case, it'd be nice to be able to tell vpnc this preference.

With this change, a vpnc configfile line should do the right thing:

      Script /usr/share/vpnc-scripts/vpnc-script --no-update-resolv.conf

Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
---
 vpnc-script | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vpnc-script b/vpnc-script
index ae13947..b986bd8 100755
--- a/vpnc-script
+++ b/vpnc-script
@@ -123,7 +123,11 @@ else
 	RESOLVEDENABLED=0
 fi
 
-if [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then
+
+if [ "$1" = "--no-update-resolv.conf" ]; then
+	MODIFYRESOLVCONF=true
+	RESTORERESOLVCONF=true
+elif [ -r /etc/openwrt_release ] && [ -n "$OPENWRT_INTERFACE" ]; then
         . /etc/functions.sh
 	include /lib/network
 	MODIFYRESOLVCONF=modify_resolvconf_openwrt
-- 
2.16.1




More information about the openconnect-devel mailing list