![]() Repeat while (current configuration of VPN is not connected) Set VPN to service "UniVPN" - your VPN name here Tell current location of network preferences Once you've added the functions, reload the terminal and call them with vpn-connect and vpn-disconnect, respectively. I tested it on Snow Leopard (but Leopard and Lion should work too). It might be possible to shorten this using arguments, but it works just fine this way. You can change the names of the functions as well, if you want to do it for different ones. You just need to change the name of the VPN connection itself, as it appears under the Network preferences. We'll use shell functions, which are available from the command line, once they are loaded.Īdd the functions below to your ~/.bash_profile or ~/.profile (whatever you use). ![]() ![]() You can also use AppleScript to connect to the VPN services of your choice. The only problem is that you cannot disconnect using this command. this one (give it a +1!).Īll you need is: networksetup -connectpppoeservice "UniVPN" For newer macOS versions, a very simple command can be used, as shown in the below answers, e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |