Scripting Auto Connect

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
Ender2k
OpenVpn Newbie
Posts: 1
Joined: Tue May 31, 2022 3:18 pm

Scripting Auto Connect

Post by Ender2k » Tue May 31, 2022 5:49 pm

I've searched and not found an answer--perhaps someone can help me.

I have a script for my daughter's MBA to connect to the home network via OpenVPN Connect, run some backups, and then disconnect. However, the CLI for Connect doesn't seem to have a command to connect via the installed profile, which is set to autologin.

The critical part here is this command:

Code: Select all

do shell script "'/Applications/OpenVPN Connect/OpenVPN Connect.app/contents/MacOS/OpenVPN Connect' --minimize --skip-startup-dialogs"
This launches Connect, but then does NOT attempt to connect to the server using the default profile. If I add a delay to my script, I can _manually_ click "connect" in the menu bar, and everything works as expected including shutting down the connection at the end.

How can I get Connect to connect the default profile via the command line or otherwise?

Post Reply