From: Paul Donald Date: Wed, 11 Mar 2026 18:25:01 +0000 (+0100) Subject: openvpn: sync with proto shell-script X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=e8ae8b1a8f85867a4b6dbf15537356554c8b9873;p=openwrt-packages.git openvpn: sync with proto shell-script add hotplug script handlers to ucode version follow-up to 647b67e18b6bf857e60e4e2e1874fd04d4138586 Signed-off-by: Paul Donald --- diff --git a/net/openvpn/files/lib/netifd/proto/openvpn.uc b/net/openvpn/files/lib/netifd/proto/openvpn.uc index 1dc823e46..127cda5e6 100755 --- a/net/openvpn/files/lib/netifd/proto/openvpn.uc +++ b/net/openvpn/files/lib/netifd/proto/openvpn.uc @@ -448,6 +448,23 @@ function proto_setup(proto) { } } + // hotplug handler scripts + if (cfg.script_security >= 2) { + push(params, '--setenv', 'INTERFACE', iface); + push(params, '--up', '/usr/libexec/openvpn-hotplug'); + if (cfg.up) push(params, '--setenv', 'user_up', cfg.up); + push(params, '--down', '/usr/libexec/openvpn-hotplug'); + if (cfg.down) push(params, '--setenv', 'user_down', cfg.down); + push(params, '--route-up', '/usr/libexec/openvpn-hotplug'); + if (cfg.route_up) push(params, '--setenv', 'user_route_up', cfg.route_up); + push(params, '--route-pre-down', '/usr/libexec/openvpn-hotplug'); + if (cfg.route_pre_down) push(params, '--setenv', 'user_route_pre_down', cfg.route_pre_down); + if (cfg.client || cfg.tls_client) { + push(params, '--ipchange', '/usr/libexec/openvpn-hotplug'); + if (cfg.ipchange) push(params, '--setenv', 'user_ipchange', cfg.ipchange); + } + } + // assemble the final command line let cmd = [ OPENVPN,