Logic Machine Forum
Scripting and OpenVPN Client - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Scripting and OpenVPN Client (/showthread.php?tid=3382)



Scripting and OpenVPN Client - emme - 21.05.2021

Hi,

is there a way to gain control of the built-in openVPN Client?

I would like to open the tunnel ONLY when needed and not keeping it always active...
I checked the docs but looks like there are no API to di that.... am I wrong?

thanks
M


RE: Scripting and OpenVPN Client - Daniel - 21.05.2021

Event script, boolean object
Code:
enabled = event.getvalue()

require('uci')
uci.set('openvpn-lm', 'openvpn', 'enabled', enabled and 1 or 0)
uci.commit('openvpn-lm')
os.execute('/etc/init.d/openvpn-lm restart')



RE: Scripting and OpenVPN Client - emme - 21.05.2021

Thanks a lot!!! Big Grin
you make my day