- Clarified text about disabling logging on the server.

- Modified the expressions that replace the logfile locations in the server configuration.
This commit is contained in:
Jelle Dekker 2017-06-25 16:56:37 +02:00
parent 3981e119f6
commit 7b74d7dc02

View file

@ -799,7 +799,7 @@ setClientDNS() {
setLoggingPolicy() {
CONLOGLOC="/var/log/openvpn.log"
STATUSLOGLOC="/var/log/openvpn-status.log"
if (whiptail --backtitle "Logging policy" --title "Disable logging" --yesno --defaultno "Do you want to disable logging of connection information?" ${r} ${c}) then
if (whiptail --backtitle "Logging policy" --title "Disable logging" --yesno --defaultno "Do you want to disable logging on the server (e.g. redirect log output to /dev/null)?" ${r} ${c}) then
CONLOGLOC="/dev/null"
STATUSLOGLOC="/dev/null"
fi
@ -912,13 +912,12 @@ EOF
$SUDO sed -i "s/1194/${PORT}/g" /etc/openvpn/server.conf
fi
# TODO: Test these expressions
# if they modified logging policy put values in server.conf
# if they modified logfile locations put values in server.conf
if [ $CONLOGLOC != "/var/log/openvpn.log" ]; then
$SUDO sed -i "s/(\/var\/log\/openvpn.log)/${CONLOGLOC}/g" /etc/openvpn/server.conf
$SUDO sed -i "s#/var/log/openvpn.log#${CONLOGLOC}#g" /etc/openvpn/server.conf
fi
if [ $STATUSLOGLOC != "/var/log/openvpn-status.log" ]; then
$SUDO sed -i "s/(\/var\/log\/openvpn-status.log)/${CONLOGLOC}/g" /etc/openvpn/server.conf
$SUDO sed -i "s#/var/log/openvpn-status.log#${STATUSLOGLOC}#g" /etc/openvpn/server.conf
fi
# if they modified protocol put value in server.conf