Merge branch 'compression'

Closes #81
This commit is contained in:
Kyle Manna 2015-11-29 10:15:57 -08:00
commit 1c290e60db
2 changed files with 11 additions and 1 deletions

View File

@ -49,6 +49,7 @@ usage() {
echo " -T Encrypt packets with the given cipher algorithm instead of the default one (tls-cipher)." echo " -T Encrypt packets with the given cipher algorithm instead of the default one (tls-cipher)."
echo " -C A list of allowable TLS ciphers delimited by a colon (cipher)." echo " -C A list of allowable TLS ciphers delimited by a colon (cipher)."
echo " -a Authenticate packets with HMAC using the given message digest algorithm (auth)." echo " -a Authenticate packets with HMAC using the given message digest algorithm (auth)."
echo " -z Enable comp-lzo compression."
} }
if [ "$DEBUG" == "1" ]; then if [ "$DEBUG" == "1" ]; then
@ -78,7 +79,7 @@ OVPN_AUTH=''
[ -r "$OVPN_ENV" ] && source "$OVPN_ENV" [ -r "$OVPN_ENV" ] && source "$OVPN_ENV"
# Parse arguments # Parse arguments
while getopts ":a:C:T:r:s:du:cp:n:DNm:t" opt; do while getopts ":a:C:T:r:s:du:cp:n:DNm:tz" opt; do
case $opt in case $opt in
a) a)
OVPN_AUTH="$OPTARG" OVPN_AUTH="$OPTARG"
@ -122,6 +123,9 @@ while getopts ":a:C:T:r:s:du:cp:n:DNm:t" opt; do
t) t)
OVPN_DEVICE="tap" OVPN_DEVICE="tap"
;; ;;
z)
OVPN_COMP_LZO=1
;;
\?) \?)
set +x set +x
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
@ -167,6 +171,7 @@ export OVPN_SERVER OVPN_ROUTES OVPN_DEFROUTE
export OVPN_SERVER_URL OVPN_ENV OVPN_PROTO OVPN_CN OVPN_PORT export OVPN_SERVER_URL OVPN_ENV OVPN_PROTO OVPN_CN OVPN_PORT
export OVPN_CLIENT_TO_CLIENT OVPN_PUSH OVPN_NAT OVPN_DNS OVPN_MTU OVPN_DEVICE export OVPN_CLIENT_TO_CLIENT OVPN_PUSH OVPN_NAT OVPN_DNS OVPN_MTU OVPN_DEVICE
export OVPN_TLS_CIPHER OVPN_CIPHER OVPN_AUTH export OVPN_TLS_CIPHER OVPN_CIPHER OVPN_AUTH
export OVPN_COMP_LZO
# Preserve config # Preserve config
if [ -f "$OVPN_ENV" ]; then if [ -f "$OVPN_ENV" ]; then
@ -211,6 +216,7 @@ EOF
[ -n "$OVPN_AUTH" ] && echo "auth $OVPN_AUTH" >> "$conf" [ -n "$OVPN_AUTH" ] && echo "auth $OVPN_AUTH" >> "$conf"
[ -n "$OVPN_CLIENT_TO_CLIENT" ] && echo "client-to-client" >> "$conf" [ -n "$OVPN_CLIENT_TO_CLIENT" ] && echo "client-to-client" >> "$conf"
[ -n "$OVPN_COMP_LZO" ] && echo "comp-lzo" >> "$conf"
[ "$OVPN_DNS" == "1" ] && for i in "${OVPN_DNS_SERVERS[@]}"; do [ "$OVPN_DNS" == "1" ] && for i in "${OVPN_DNS_SERVERS[@]}"; do
echo "push dhcp-option DNS $i" >> "$conf" echo "push dhcp-option DNS $i" >> "$conf"

View File

@ -84,6 +84,10 @@ $OVPN_ADDITIONAL_CLIENT_CONFIG
if [ -n "$OVPN_AUTH" ]; then if [ -n "$OVPN_AUTH" ]; then
echo "auth $OVPN_AUTH" echo "auth $OVPN_AUTH"
fi fi
if [ -n "$OVPN_COMP_LZO" ]; then
echo "comp-lzo"
fi
} }
dir="$OPENVPN/clients/$cn" dir="$OPENVPN/clients/$cn"