1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-18 13:23:57 +02:00

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 <name>'

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2023-12-20 14:20:13 +01:00
parent 9a27865acb
commit 053e588162

View File

@ -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
}