For me, the VPN menu in Ventura’s settings app didn’t work properly. WireGuard and IKEv2 connection were not always initiated when toggling the button.
I’ve deleted the Ventura volume today, but I’ve saved this AppleScript I used to easily connect to VPNs. Maybe someone finds it helpful.
It can be saved as an app from Script Editor. 3 connections are just as an example, you can add more.
A simple script, that can be saved as an app, to turn off all VPN connections:
Additional options can be added to each, like turning Ethernet/Wi-Fi on or off.
Wi-Fi on
Wi-Fi off
Ethernet on
Ethernet off
There are other scripts available online and there is also VPNStatus https://github.com/Timac/VPNStatus , but I haven’t tested it in Ventura.
I’ve deleted the Ventura volume today, but I’ve saved this AppleScript I used to easily connect to VPNs. Maybe someone finds it helpful.
Code:
set theVPNs to {"VPN1", "VPN2", "VPN3"}
set the selectedVPN to choose from list the theVPNs with prompt "Please select a VPN connection:" default items {"VPN2"}
if selectedVPN = {"VPN1"} then
do shell script "scutil --nc start 'VPN1'"
end if
if selectedVPN = {"VPN2"} then
do shell script "scutil --nc start 'VPN2'"
end if
if selectedVPN = {"VPN3"} then
do shell script "scutil --nc start 'VPN3'"
end if
A simple script, that can be saved as an app, to turn off all VPN connections:
Code:
do shell script "scutil --nc stop 'VPN1'"
do shell script "scutil --nc stop 'VPN2'"
do shell script "scutil --nc stop 'VPN3'"
Wi-Fi on
Code:
do shell script "networksetup -setairportpower en0 on"
Code:
do shell script "networksetup -setairportpower en0 off"
Code:
do shell script "networksetup -setnetworkserviceenabled Ethernet on"
Code:
do shell script "networksetup -setnetworkserviceenabled Ethernet off"