Skip to content

Commit

Permalink
Add --flavor=localdns example [#64]
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed May 22, 2024
1 parent 58b4ef2 commit 8ef170c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions flavors/localdns/connect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
####################################################################
# Tunnel only UCSF intranet
#
# Install:
# mkdir -p ~/.config/ucsf-vpn/flavors/localdns/
# cp connect.sh ~/.config/ucsf-vpn/flavors/localdns/
#
# Requires:
# https://github.com/HenrikBengtsson/ucsf-vpn
#
# Description:
# This script overrides parts of the default behavior of
# /usr/share/vpnc-scripts/vpnc-script. It's been verified to
# to work on Ubuntu 22.04.
#
# Authors: Henrik Bengtsson
# Version: 2024-05-22
# License: GPL
####################################################################

#-------------------------------------------------------------------
# Tweak DNS lookup
#-------------------------------------------------------------------
# Tricks modify_resolvconf_generic() to prepend the local nameserver
# before the ones that the VPN server provides.
_nameservers_=$(grep "^nameserver[[:blank:]]" /etc/resolv.conf | sed -E 's/nameserver[[:blank:]]+//')
INTERNAL_IP4_DNS="${_nameservers_} $INTERNAL_IP4_DNS"

0 comments on commit 8ef170c

Please sign in to comment.