Starting (openvpn) script when using WPS-Button

Hello,

I‘m relatively new and like to experiment with features. However I could not find the right topics to solve my following request:

I want to enable (and Save & apply) my openvpn setting, when clicking the button on my repeater.
On the other hand it should disable when clicking on the button again.

This is my setting:

Is this request possible and if yes, could you please give me directions to the right topics so I can solve it?

Thank you!

You can do this with the hotplug button functionality (I've done this exact thing).

Let us know if you have questions or difficulty.

3 Likes

Thank you so much for the reply!

I almost got it. My only difficult now is to write a functional action.

Could you tell me what I have to write in the „.handler= …“ to enable the vpn service?

Try

/etc/init.d/openvpn start
2 Likes

No, according to configuration, openvpn is enabled as service, and just flag 'enabled' of instance is modified. Something like:
uci set openvpn.NordVPN_US_10064.enabled=1;uci commit openvpn

1 Like

This will select the specific profile/config file to use, but OpenVPN will not start when you run this command.

The one I posted earlier will start the VPN service (the assumption, when starting the service, is that a config file is already selected, as was true in the screenshot).

2 Likes

Thank you both so much for the help!

It‘s working perfectly now :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.