From 8fe9940db66517679f09fa1d2f6f79229b6a8361 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 30 Nov 2018 14:03:50 +0100 Subject: openvpn: add generic hotplug mechanism Pass a default --up and --down executable to each started OpenVPN instance which triggers /etc/hotplug.d/openvpn/ scripts whenever an instance goes up or down. User-configured up and down scripts are invoked by the default shipped 01-user hotplug handler to ensure that existing setups continue to work as before. As a consequence of this change, the up, down and script_security OpenVPN options are removed from the option file, since we're always passing them via the command line, they do not need to get included into the generated configuration. Signed-off-by: Florian Eckert [reword commit message, move hotplug executable to /usr/libexec] Signed-off-by: Jo-Philipp Wich --- package/network/services/openvpn/Makefile | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'package/network/services/openvpn/Makefile') diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index 5f102d967d..f1170bbd37 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn PKG_VERSION:=2.4.9 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ @@ -102,6 +102,7 @@ endef define Package/openvpn-$(BUILD_VARIANT)/conffiles /etc/config/openvpn +/etc/openvpn.user endef define Package/openvpn-$(BUILD_VARIANT)/install @@ -111,7 +112,9 @@ define Package/openvpn-$(BUILD_VARIANT)/install $(1)/etc/init.d \ $(1)/etc/config \ $(1)/etc/openvpn \ - $(1)/lib/upgrade/keep.d + $(1)/lib/upgrade/keep.d \ + $(1)/usr/libexec \ + $(1)/etc/hotplug.d/openvpn $(INSTALL_BIN) \ $(PKG_INSTALL_DIR)/usr/sbin/openvpn \ @@ -120,6 +123,19 @@ define Package/openvpn-$(BUILD_VARIANT)/install $(INSTALL_BIN) \ files/openvpn.init \ $(1)/etc/init.d/openvpn + + $(INSTALL_BIN) \ + files/usr/libexec/openvpn-hotplug \ + $(1)/usr/libexec/openvpn-hotplug + + $(INSTALL_DATA) \ + files/etc/hotplug.d/openvpn/01-user \ + $(1)/etc/hotplug.d/openvpn/01-user + + $(INSTALL_DATA) \ + files/etc/openvpn.user \ + $(1)/etc/openvpn.user + $(INSTALL_DATA) \ files/openvpn.options \ $(1)/usr/share/openvpn/openvpn.options -- cgit v1.2.3