Support setting of lzo compression (yes/no).

This commit is contained in:
2018-03-18 19:39:18 +01:00
parent 267cb8f1f5
commit 4bef4e3c0f
3 changed files with 90 additions and 18 deletions

View File

@@ -171,6 +171,15 @@ 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=true
elif [[ "$LZO_COMPRESSION" = "yes" ]] ; then
LZO_COMPRESSION=true
else
LZO_COMPRESSION=false
fi
EASY_RSA_DIR="${OPENVPN_BASE_DIR}/easy-rsa"
OPENVPN_CCD_DIR="${OPENVPN_BASE_DIR}/ccd/server-${OPENVPN_NAME}"
@@ -521,7 +530,16 @@ cat <<EOF >> "$_client_conf_file" 2>> "$log_file"
# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
;comp-lzo
EOF
if $LZO_COMPRESSION ; then
cat <<EOF >> ${_server_conf_file} 2>> "$log_file"
comp-lzo
EOF
fi
cat <<EOF >> ${_server_conf_file} 2>> "$log_file"
# Verbosity level.
# 0 -- quiet except for fatal errors.