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