Is there a way to connect/disconnect to a OpenVPN/WireGuard client vpn programaticlly?

Answered you here Can’t execute a simple curl command? - #4 by WhiskerBiscuit