Create a new alias within bash/zsh to connect or disconnect from the VPN with ease. No clicking required!
- Clone
.vpnStatus.sh
,.motd.sh
and.vpn_creds
to ~/ - Run
chmod +x ~/.vpnStatus.sh ~/.motd.sh && echo -e "alias vpn='~/.vpnStatus.sh'\n~/.motd.sh" | tee -a ~/.bashrc ~/.zshrc && source ~/.bashrc && source ~/.zshrc
within your terminal - Extra: Download a different terminal such as iTerm2 or Warp to not run into the issues that the default Mac terminal causes with this script
- Edit
.vpn_creds
with your own information -
username
being the username you'd find when connecting to AnyConnect
-
password
being the password you'd use to connect
-
- Completely remove
username
andpassword
and replace them with your own values. Leavey
as is.
- Completely remove
Within Warp or iTerm2, start a new terminal tab or exit and then open up a terminal instance again to see if you're connected to the vpn.
-
Ensure that Cisco AnyConnect is not running
-
Enter
vpn
in the terminal to be prompted to connect ("y" or "n"). This will also notify you whether you're currently connected or not.