If current configuration of myVPN is not connected then Tell current location of network preferences Essentially what we’re doing is placing a connection script into Login Items so that it loads automatically on system start and user login events:
This auto-connect VPN script should work on any version of macOS or Mac OS X system software. How to Connect to VPN on Boot or Login in Mac OS X, Automatically If you do not have or use a VPN (Virtual Private Network), then this trick will be of little use to a particular Mac.
Obviously you’ll need an active VPN service and VPN location setup in Mac OS for this script to work, otherwise the script will have nothing to connect to upon login and system boot.