From: Florian Eckert Date: Wed, 20 Dec 2023 13:20:13 +0000 (+0100) Subject: openvpn: Added option to not start the native OpenVPN configurations on boot X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=053e588162a8c559e1c1731cb8bf8d109576ca25;p=openwrt-packages.git openvpn: Added option to not start the native OpenVPN configurations on boot OpenVPN configurations that have a uci entry, the enable/enabled option can be used to control whether the OpenVPN connection should be started at system startup or not. OpenVPN configurations that are located under '/etc/openvpn/' are always started at system boot. To ensure that these connections can also be started later, they must 'not' be started automatically during system boot. This can be prevented with the following entry in the OpenVPN configuration. config globals 'globals' option autostart '0' These OpenVPN configurations can then be started later with the command. '/etc/init.d/openvpn start ' Signed-off-by: Florian Eckert --- diff --git a/net/openvpn/files/openvpn.init b/net/openvpn/files/openvpn.init index 806afe275..6f4dc4206 100644 --- a/net/openvpn/files/openvpn.init +++ b/net/openvpn/files/openvpn.init @@ -271,7 +271,12 @@ start_service() { else config_foreach start_uci_instance 'openvpn' - start_path_instances + auto="$(uci_get openvpn globals autostart 1)" + if [ "$auto" = "1" ]; then + start_path_instances + else + logger -t openvpn "Autostart for configs in '$PATH_INSTANCE_DIR/*.conf' disabled" + fi fi }