Last active
June 14, 2018 09:50
-
-
Save alext/58f3b3d5ff9262b5064f0e90f6bc04bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# vpnc-script wrapper for use with openconnect that Prevents routing DNS over the VPN. | |
# | |
# Example usage: | |
# openconnect https://vpn.example.com/profile --script '/path/to/vpnc-script-no-dns' | |
unset INTERNAL_IP4_DNS | |
unset CISCO_DEF_DOMAIN | |
set +eu | |
SCRIPT_LOCATIONS=" | |
/etc/vpnc/vpnc-script | |
/usr/share/vpnc-scripts/vpnc-script | |
/usr/local/etc/vpnc-script | |
/opt/boxen/homebrew/etc/vpnc-script | |
" | |
for script in $SCRIPT_LOCATIONS; do | |
if [ -f "${script}" ]; then | |
. "${script}" | |
exit 0 | |
fi | |
done | |
echo "$0: Cannot locate vpnc-script" | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment