From 19fe6626f1d7d3cb2f46adf9277a127ba242f9a3 Mon Sep 17 00:00:00 2001 From: Angristan Date: Mon, 26 Jun 2017 02:17:14 +0200 Subject: [PATCH] Implements OpenVPN 2.4 changes for Arch Linux (kind of) Since OpenVPN 2.4 is out on Arch, the script wasn't working completely because of this : https://www.archlinux.org/news/openvpn-240-update-requires-administrative-interaction/ There is a new path for OpenVPN server config. This is just needed on Arch for now, and you're probably not going to run an OpenVPN client on an OpenVPN server. Thus I modified the systemd script to use `/etc/openvpn/` and `server.conf` instead of the new `/etc/openvpn/server/` and `openvpn.conf`. By using the same paths as the other distros, I avoid to rewrite the entire script to change the paths... It's not 100% clean, but it works pretty well. If you have any objection please leave a comment. Also, I updated the new service name. As far as I tested, it's working fine on Arch Linux for now. Fixes #63 and #61 --- openvpn-install.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index 2b0e68f..76c9c83 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -558,8 +558,17 @@ verb 3" >> /etc/openvpn/server.conf fi else if pgrep systemd-journal; then - systemctl restart openvpn@server.service - systemctl enable openvpn@server.service + if [[ "$OS" = 'arch']]; then + #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|%i.conf|server.conf|' /usr/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 + systemctl enable openvpn@server.service + fi else service openvpn restart chkconfig openvpn on