From 191cb45106979cba8b9b5e968fc18d2f13381f79 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 16 May 2016 09:56:27 -0700 Subject: [PATCH] allow specifying extra config --- bin/ovpn_genconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/ovpn_genconfig b/bin/ovpn_genconfig index c957b80..dfa4555 100755 --- a/bin/ovpn_genconfig +++ b/bin/ovpn_genconfig @@ -52,6 +52,7 @@ usage() { echo " -z Enable comp-lzo compression." echo " -2 Enable two factor authentication using Google Authenticator." echo " -f Set the fragment directive." + echo " -e Add extra server config" } if [ "$DEBUG" == "1" ]; then @@ -76,16 +77,20 @@ TMP_DNS_SERVERS=() OVPN_TLS_CIPHER='' OVPN_CIPHER='' OVPN_AUTH='' +OVPN_EXTRA_CONFIG='' # Import defaults if present [ -r "$OVPN_ENV" ] && source "$OVPN_ENV" # Parse arguments -while getopts ":a:C:T:r:s:du:cp:n:DNmf:tz2" opt; do +while getopts ":a:e:C:T:r:s:du:cp:n:DNmf:tz2" opt; do case $opt in a) OVPN_AUTH="$OPTARG" ;; + e) + OVPN_EXTRA_CONFIG="$OPTARG" + ;; C) OVPN_CIPHER="$OPTARG" ;; @@ -230,6 +235,8 @@ EOF [ -n "$OVPN_FRAGMENT" ] && echo "fragment $OVPN_FRAGMENT" >> "$conf" +[ -n "$OVPN_EXTRA_CONFIG" ] && echo "$OVPN_EXTRA_CONFIG" >> "$conf" + [ "$OVPN_DNS" == "1" ] && for i in "${OVPN_DNS_SERVERS[@]}"; do echo "push dhcp-option DNS $i" >> "$conf" done