Don't restart openvpn if it's not installed

This commit is contained in:
Bob Mottram 2017-11-07 15:40:00 +00:00
parent 5ce7c214d6
commit 7e25a5303e
1 changed files with 6 additions and 0 deletions

View File

@ -59,11 +59,17 @@ vpn_variables=(MY_EMAIL_ADDRESS
VPN_TLS_PORT)
function logging_on_vpn {
if [ ! -f /etc/openvpn/server.conf ]; then
return
fi
sed -i 's|status .*|status /var/log/openvpn.log|g' /etc/openvpn/server.conf
systemctl restart openvpn
}
function logging_off_vpn {
if [ ! -f /etc/openvpn/server.conf ]; then
return
fi
sed -i 's|status .*|status /dev/null|g' /etc/openvpn/server.conf
systemctl restart openvpn
}