LEDE /Service/OpenVPN start and stop with uci?

Hi all,

It's all setup and working via luci; various vpn's located in /etc/config/openvpn file but I was hoping to bypass usage via luci and instead start and stop connections via uci ssh, anyone know how to achieve this?

I'm trying to avoid re-writing out separate configs that are traditionally more cli uci friendly...

Like is there a command that emulates clicking start and stop for a /LEDE/Service/OpenVPN/ client config?

/etc/init.d/openvpn start
/etc/init.d/openvpn stop

Not UCI, but will do what you want from the command line.

Edit. I see you want to switch config, not simply start/stop.

You could make multiple openvpn client files and call them directly when launching openvpn or you could use the uci to enable and disable accordingly. There is a UCI line for enabled, just call
uci set openvpn.openvpn-name.enabled=1
And enabled=0 to disable.

uci commit

The restart or start/stop openvpn service.

1 Like
service openvpn start instance_name
service openvpn stop instance_name

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