Fix compression and add none choice

Fix compression choice (wasn't put in the client conf so connection was failing) and add the choice to disable compression
This commit is contained in:
Angristan 2017-11-16 23:51:02 +01:00
parent 9b65d3ea39
commit 8c26cadd06

View file

@ -249,8 +249,9 @@ else
echo "Choose which compression algorithm you want to use:" echo "Choose which compression algorithm you want to use:"
echo " 1) LZ4 (faster)" echo " 1) LZ4 (faster)"
echo " 2) LZ0 (use for OpenVPN 2.3 compatibility)" echo " 2) LZ0 (use for OpenVPN 2.3 compatibility)"
while [[ $COMPRESSION != "1" && $COMPRESSION != "2" ]]; do echo " 3) No compression"
read -p "Compression algorithm [1-2]: " -e -i 1 COMPRESSION while [[ $COMPRESSION != "1" && $COMPRESSION != "2" && $COMPRESSION != "3" ]]; do
read -p "Compression algorithm [1-3]: " -e -i 1 COMPRESSION
done done
case $COMPRESSION in case $COMPRESSION in
1) 1)
@ -259,6 +260,9 @@ else
2) 2)
COMPRESSION="lzo" COMPRESSION="lzo"
;; ;;
3)
# We don't do anything
;;
esac esac
echo "" echo ""
echo "See https://github.com/Angristan/OpenVPN-install#encryption to learn more about " echo "See https://github.com/Angristan/OpenVPN-install#encryption to learn more about "
@ -734,9 +738,13 @@ $CIPHER
ncp-disable ncp-disable
tls-server tls-server
tls-version-min 1.2 tls-version-min 1.2
tls-cipher $CC_ENC tls-cipher $CC_ENC" >> /etc/openvpn/server.conf
compress $COMPRESSION
status openvpn.log if [[ $COMPRESSION == "lz4" || $COMPRESSION == "lzo" ]]; then
echo "compress $COMPRESSION" >> /etc/openvpn/server.conf
fi
echo "status openvpn.log
verb 3" >> /etc/openvpn/server.conf verb 3" >> /etc/openvpn/server.conf
# Create the sysctl configuration file if needed (mainly for Arch Linux) # Create the sysctl configuration file if needed (mainly for Arch Linux)
@ -872,8 +880,13 @@ auth $HMAC_AUTH
$CIPHER $CIPHER
tls-client tls-client
tls-version-min 1.2 tls-version-min 1.2
tls-cipher $CC_ENC tls-cipher $CC_ENC" >> /etc/openvpn/client-template.txt
setenv opt block-outside-dns
if [[ $COMPRESSION == "lz4" || $COMPRESSION == "lzo" ]]; then
echo "compress $COMPRESSION" >> /etc/openvpn/client-template.txt
fi
echo "setenv opt block-outside-dns
verb 3" >> /etc/openvpn/client-template.txt verb 3" >> /etc/openvpn/client-template.txt
# Generate the custom client.ovpn # Generate the custom client.ovpn