fix
This commit is contained in:
parent
75faa3a87e
commit
2d96bfe9db
1 changed files with 574 additions and 570 deletions
|
@ -3,6 +3,7 @@
|
||||||
# Secure OpenVPN server installer for Debian, Ubuntu, CentOS and Arch Linux
|
# Secure OpenVPN server installer for Debian, Ubuntu, CentOS and Arch Linux
|
||||||
# https://github.com/Angristan/OpenVPN-install
|
# https://github.com/Angristan/OpenVPN-install
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
if [[ "$EUID" -ne 0 ]]; then
|
if [[ "$EUID" -ne 0 ]]; then
|
||||||
echo "Sorry, you need to run this as root"
|
echo "Sorry, you need to run this as root"
|
||||||
|
@ -614,26 +615,29 @@ verb 3" >> /etc/openvpn/server.conf
|
||||||
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
|
||||||
else
|
else
|
||||||
systemctl restart openvpn@server.service
|
sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn\@.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart openvpn\@server.service
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
/etc/init.d/openvpn restart
|
/etc/init.d/openvpn restart
|
||||||
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|/etc/openvpn/server|/etc/openvpn|' /usr/lib/systemd/system/openvpn-server@.service
|
sed -i 's|LimitNPROC|#LimitNPROC|' /usr/lib/systemd/system/openvpn-server\@.service
|
||||||
sed -i 's|%i.conf|server.conf|' /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
|
||||||
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
|
||||||
else
|
else
|
||||||
systemctl restart openvpn@server.service
|
systemctl restart openvpn\@server.service
|
||||||
systemctl enable openvpn@server.service
|
systemctl enable openvpn\@server.service
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
service openvpn restart
|
service openvpn restart
|
||||||
|
|
Loading…
Reference in a new issue