openvpn: add possibility to start openvpn_path_instance on request
authorFlorian Eckert <[email protected]>
Wed, 20 Dec 2023 09:19:24 +0000 (10:19 +0100)
committerFlorian Eckert <[email protected]>
Wed, 20 Dec 2023 14:01:39 +0000 (15:01 +0100)
This commit adds the possibility that an OpenVPN instance located under
'/etc/openvpn' can also be started with the command.
'/etc/init.d/openvpn start <name>'

Signed-off-by: Florian Eckert <[email protected]>
net/openvpn/files/openvpn.init

index 791018cc4b669d5bf2e832771516dca4573f9b21..806afe2753ff85ee19f01ac92cde1971a136f9b4 100644 (file)
@@ -263,8 +263,11 @@ start_service() {
        config_load 'openvpn'
 
        if [ -n "$instance" ]; then
-               [ "$instance_found" -gt 0 ] || return
-               start_uci_instance "$instance"
+               if [ "$instance_found" -gt 0 ]; then
+                       start_uci_instance "$instance"
+               else
+                       start_path_instance "$instance"
+               fi
        else
                config_foreach start_uci_instance 'openvpn'