mirror of
https://github.com/namibia/openvpn-install.git
synced 2024-11-18 02:05:12 +00:00
Merge pull request #139 from Angristan/systemd-openvz-fix
Fix systemd service on OpenVZ
This commit is contained in:
commit
bb23ed1227
@ -615,17 +615,13 @@ verb 3" >> /etc/openvpn/server.conf
|
|||||||
if [[ "$OS" = 'debian' ]]; then
|
if [[ "$OS" = 'debian' ]]; then
|
||||||
# Little hack to check for systemd
|
# Little hack to check for systemd
|
||||||
if pgrep systemd-journal; then
|
if pgrep systemd-journal; then
|
||||||
if [[ "$VERSION_ID" = 'VERSION_ID="9"' ]]; then
|
#Workaround to fix OpenVPN service on OpenVZ
|
||||||
#Workaround to fix OpenVPN service on Debian 9 OpenVZ
|
sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn\@.service
|
||||||
sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn-server\@.service
|
sed -i 's|/etc/openvpn/server|/etc/openvpn|' /lib/systemd/system/openvpn\@.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\@.service
|
||||||
sed -i 's|%i.conf|server.conf|' /lib/systemd/system/openvpn-server\@.service
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl restart openvpn-server@openvpn.service
|
systemctl restart openvpn
|
||||||
systemctl enable openvpn-server@openvpn.service
|
systemctl enable openvpn
|
||||||
else
|
|
||||||
systemctl restart openvpn@server.service
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
/etc/init.d/openvpn restart
|
/etc/init.d/openvpn restart
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user