Skip to content

Instantly share code, notes, and snippets.

@loranger
Created June 3, 2024 06:28
Show Gist options
  • Save loranger/75de9b483710a2cdabd736209ecc05e1 to your computer and use it in GitHub Desktop.
Save loranger/75de9b483710a2cdabd736209ecc05e1 to your computer and use it in GitHub Desktop.
Manage Global Protect VPN client from cli
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)
echo "Starting GlobalProtect..."
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist
echo "Done!"
;;
stop)
echo "Stopping GlobalProtect..."
launchctl remove com.paloaltonetworks.gp.pangps
launchctl remove com.paloaltonetworks.gp.pangpa
echo "Done!"
;;
*)
echo "'$1' is not a valid verb."
echo "Usage: $0 {start|stop}"
exit 2
;;
esac
;;
*)
echo "Too many args provided ($#)."
echo "Usage: $0 {start|stop}"
exit 3
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment