From: Michal Hrusecky Date: Mon, 15 May 2023 12:30:29 +0000 (+0200) Subject: openvpn: Add more hotplug events X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=f8a8b71e26b9bdbf86fbb7d4d1482637af7f3ba4;p=openwrt-packages.git openvpn: Add more hotplug events OpenVPN supports more hooks than just 'up' and 'down'. Especially reacting to 'route-up' and 'route-pre-down' events could be important. When routing table changes, it can make sense to adapt firewall, run some tests or change even more routes. This change passes those events to hotplug, so it is easy to react to them without changing configuration files provided by VPN provider. Signed-off-by: Michal Hrusecky --- diff --git a/net/openvpn/Makefile b/net/openvpn/Makefile index fd6e7bd54..213f027fd 100644 --- a/net/openvpn/Makefile +++ b/net/openvpn/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn PKG_VERSION:=2.5.8 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ diff --git a/net/openvpn/files/openvpn.init b/net/openvpn/files/openvpn.init index 380b42349..b5f612e46 100644 --- a/net/openvpn/files/openvpn.init +++ b/net/openvpn/files/openvpn.init @@ -153,6 +153,9 @@ openvpn_add_instance() { --config "$conf" \ --up "/usr/libexec/openvpn-hotplug up $name" \ --down "/usr/libexec/openvpn-hotplug down $name" \ + --route-up "/usr/libexec/openvpn-hotplug route-up $name" \ + --route-pre-down "/usr/libexec/openvpn-hotplug route-pre-down $name" \ + --ipchange "/usr/libexec/openvpn-hotplug ipchange $name" \ ${up:+--setenv user_up "$up"} \ ${down:+--setenv user_down "$down"} \ --script-security "${security:-2}" \