fix
This commit is contained in:
parent
9fff19fcad
commit
9ea6cbe6c4
1 changed files with 16 additions and 7 deletions
|
@ -606,14 +606,23 @@ 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"' ]] || [[ "$VERSION_ID" = 'VERSION_ID="16.04"' ]]; then
|
if [[ "$VERSION_ID" = 'VERSION_ID="9"' ]]; then
|
||||||
#Workaround to fix OpenVPN service on Debian 9 OpenVZ
|
#Workaround to fix OpenVPN service on Debian 9 OpenVZ
|
||||||
sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn-server\@.service
|
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|/etc/openvpn/server|/etc/openvpn|' /lib/systemd/system/openvpn-server\@.service
|
||||||
sed -i 's|%i.conf|server.conf|' /lib/systemd/system/openvpn-server\@.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-server@openvpn.service
|
||||||
systemctl enable openvpn-server@openvpn.service
|
systemctl enable openvpn-server@openvpn.service
|
||||||
|
elif [[ "$VERSION_ID" = 'VERSION_ID="16.04"' ]]; then
|
||||||
|
#The file is in a other dir
|
||||||
|
sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn\@.service
|
||||||
|
sed -i 's|/etc/openvpn/server|/etc/openvpn|' /lib/systemd/system/openvpn\@.service
|
||||||
|
sed -i 's|%i.conf|server.conf|' /lib/systemd/system/openvpn\@.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart openvpn-serve\@openvpn.service
|
||||||
|
systemctl enable openvpn-server@openvpn.service
|
||||||
|
|
||||||
else
|
else
|
||||||
systemctl restart openvpn@server.service
|
systemctl restart openvpn@server.service
|
||||||
fi
|
fi
|
||||||
|
@ -622,11 +631,11 @@ verb 3" >> /etc/openvpn/server.conf
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if pgrep systemd-journal; then
|
if pgrep systemd-journal; then
|
||||||
if [[ "$OS" = 'arch' ]]; then
|
if [[ "$OS" = 'arch' ]] || [[ "$VERSION_ID" = 'VERSION_ID="16.04"' ]]; then
|
||||||
#Workaround to avoid rewriting the entire script for Arch
|
#Workaround to avoid rewriting the entire script for Arch
|
||||||
sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn-server\@.service
|
sed -i 's|LimitNPROC|#LimitNPROC|' /usr/lib/systemd/system/openvpn-server\@.service
|
||||||
sed -i 's|/etc/openvpn/server|/etc/openvpn|' /usr/lib/systemd/system/openvpn-server@.service
|
sed -i 's|/etc/openvpn/server|/etc/openvpn|' /usr/lib/systemd/system/openvpn-server\@.service
|
||||||
sed -i 's|%i.conf|server.conf|' /usr/lib/systemd/system/openvpn-server@.service
|
sed -i 's|%i.conf|server.conf|' /usr/lib/systemd/system/openvpn-server\@.service
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl restart openvpn-server@openvpn.service
|
systemctl restart openvpn-server@openvpn.service
|
||||||
systemctl enable openvpn-server@openvpn.service
|
systemctl enable openvpn-server@openvpn.service
|
||||||
|
|
Loading…
Reference in a new issue