1
1
mirror of https://github.com/namibia/openvpn-install.git synced 2024-11-17 17:55:12 +00:00

Fix for Debian 9 on OpenVZ

This commit is contained in:
Angristan 2017-07-14 17:15:07 +02:00 committed by GitHub
parent 276284458f
commit c703d41795

View File

@ -552,7 +552,17 @@ verb 3" >> /etc/openvpn/server.conf
if [[ "$OS" = 'debian' ]]; then
# Little hack to check for systemd
if pgrep systemd-journal; then
systemctl restart openvpn@server.service
if [[ "$VERSION_ID" = 'VERSION_ID="9"' ]]; then
#Workaround to fix OpenVPN service on Debian 9 OpenVZ
sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn-server\@.service
sed -i 's|/etc/openvpn/server|/etc/openvpn|' /lib/systemd/system/openvpn-server\@.service
sed -i 's|%i.conf|server.conf|' /lib/systemd/system/openvpn-server\@.service
systemctl daemon-reload
systemctl restart openvpn-server@openvpn.service
systemctl enable openvpn-server@openvpn.service
else
systemctl restart openvpn@server.service
fi
else
/etc/init.d/openvpn restart
fi