Skip to content

Instantly share code, notes, and snippets.

@orientalperil
Forked from kaleksandrov/global-protect.sh
Last active April 11, 2021 05:43
Show Gist options
  • Select an option

  • Save orientalperil/d0d8ea449958e715c876d9f312d0f734 to your computer and use it in GitHub Desktop.

Select an option

Save orientalperil/d0d8ea449958e715c876d9f312d0f734 to your computer and use it in GitHub Desktop.
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/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!"
;;
enable)
echo "Stopping GlobalProtect..."
launchctl load -w /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist
launchctl load -w /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist
echo "Done!"
;;
disable)
echo "Stopping GlobalProtect..."
launchctl unload -w /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist
launchctl unload -w /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist
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