- Little fix for Debian Jessie
- Better systemd detection
- Fixed revocation on CentOS
This commit is contained in:
Nyr 2015-04-28 18:35:54 +02:00
parent 68b5ff7e99
commit cf48ecd3b0

View File

@ -115,7 +115,16 @@ if [[ -e /etc/openvpn/server.conf ]]; then
# If it's the first time revoking a cert, we need to add the crl-verify line # If it's the first time revoking a cert, we need to add the crl-verify line
if ! grep -q "crl-verify" "/etc/openvpn/server.conf"; then if ! grep -q "crl-verify" "/etc/openvpn/server.conf"; then
echo "crl-verify /etc/openvpn/easy-rsa/2.0/keys/crl.pem" >> "/etc/openvpn/server.conf" echo "crl-verify /etc/openvpn/easy-rsa/2.0/keys/crl.pem" >> "/etc/openvpn/server.conf"
# And restart
if pgrep systemd-journal; then
systemctl restart openvpn@server.service
else
if [[ "$OS" = 'debian' ]]; then
/etc/init.d/openvpn restart /etc/init.d/openvpn restart
else
service openvpn restart
fi
fi
fi fi
echo "" echo ""
echo "Certificate for client $CLIENT revoked" echo "Certificate for client $CLIENT revoked"
@ -288,10 +297,14 @@ else
fi fi
# And finally, restart OpenVPN # And finally, restart OpenVPN
if [[ "$OS" = 'debian' ]]; then if [[ "$OS" = 'debian' ]]; then
/etc/init.d/openvpn restart
else
# Little hack to check for systemd # Little hack to check for systemd
if pidof systemd; then if pgrep systemd-journal; then
systemctl restart openvpn@server.service
else
/etc/init.d/openvpn restart
fi
else
if pgrep systemd-journal; then
systemctl restart openvpn@server.service systemctl restart openvpn@server.service
systemctl enable openvpn@server.service systemctl enable openvpn@server.service
else else