From 2e96d2415179433731706f141d731b093c55f3fa Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 9 Dec 2024 19:23:01 +0100 Subject: [PATCH] Adjust client configuration version 3 for windows openvpn connector. --- build_key-pass.sh | 14 ++++++++++++++ create_key_config.sh | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/build_key-pass.sh b/build_key-pass.sh index 3610481..c3720b9 100755 --- a/build_key-pass.sh +++ b/build_key-pass.sh @@ -964,6 +964,20 @@ comp-lzo yes EOF fi +if [[ -n ${DNS_SERVER} ]] && [[ "${DNS_SERVER,,}" != "none" ]] ; then + cat <> ${_client_openvpn_connector_v3} 2>> "$log_file" + +# Pusch Nameserver Settinggs.. +dhcp-option DNS ${DNS_SERVER} +EOF + + if [[ -n ${SEARCH_DOMAINS} ]] && [[ "${SEARCH_DOMAINS,}" != "none" ]] ; then + cat <> ${_client_openvpn_connector_v3} 2>> "$log_file" +dhcp-option DOMAIN ${SEARCH_DOMAINS} +EOF + fi +fi + cat <> ${_client_openvpn_connector_v3} 2>> "$log_file" # --auth-nocache diff --git a/create_key_config.sh b/create_key_config.sh index 4f47b69..e0998b4 100755 --- a/create_key_config.sh +++ b/create_key_config.sh @@ -226,7 +226,6 @@ fi [[ -n "$OPENVPN_SERVER" ]] || fatal "OpenVPN Server (parameter OPENVPN_SERVER ) not present!" [[ -n "$SERVER_PORT" ]] || fatal "Server Port (parameter SERVER_PORT ) not present!" - if [[ -z "$LZO_COMPRESSION" ]]; then LZO_COMPRESSION=false elif [[ "${LZO_COMPRESSION,,}" = "yes" ]] ; then @@ -906,6 +905,20 @@ comp-lzo yes EOF fi +if [[ -n ${DNS_SERVER} ]] && [[ "${DNS_SERVER,,}" != "none" ]] ; then + cat <> ${_client_openvpn_connector_v3} 2>> "$log_file" + +# Pusch Nameserver Settinggs.. +dhcp-option DNS ${DNS_SERVER} +EOF + + if [[ -n ${SEARCH_DOMAINS} ]] && [[ "${SEARCH_DOMAINS,}" != "none" ]] ; then + cat <> ${_client_openvpn_connector_v3} 2>> "$log_file" +dhcp-option DOMAIN ${SEARCH_DOMAINS} +EOF + fi +fi + cat <> ${_client_openvpn_connector_v3} 2>> "$log_file" # --auth-nocache