From 510f9e1bf8b9a681d224299ee7c82953752555ef Mon Sep 17 00:00:00 2001 From: Nyr Date: Fri, 24 May 2019 14:47:02 +0200 Subject: [PATCH] Remove support for old init systems It was broken since b3953963bac3ef048ffd09d7dcb9992eea383acb anyway. --- openvpn-install.sh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 0c78e50..9a500d8 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -358,21 +358,9 @@ exit 0' > $RCLOCAL semanage port -a -t openvpn_port_t -p $PROTOCOL $PORT fi # And finally, restart OpenVPN - if [[ "$OS" = 'debian' ]]; then - # Little hack to check for systemd - 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 enable openvpn@server.service - else - service openvpn restart - chkconfig openvpn on - fi + systemctl restart openvpn@server.service + if [[ "$OS" = 'centos' ]]; then + systemctl enable openvpn@server.service fi # If the server is behind a NAT, use the correct IP address if [[ "$PUBLICIP" != "" ]]; then