Last active
December 2, 2021 12:44
-
-
Save phnahes/939a870796d4c6952055b451a5865c47 to your computer and use it in GitHub Desktop.
Control GlobalProtection in MacOs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#https://www.robertsetiadi.com/disabling-globalprotect-vpn-auto-run-during-mac-start-up/ | |
case $# in | |
0) | |
echo "Usage: $0 {start|stop}" | |
exit 1 | |
;; | |
1) | |
case $1 in | |
start) | |
$0 stop > /dev/null | |
echo "Starting GlobalProtect..." | |
launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangp* | |
launchctl kickstart -k gui/`id -u`/com.paloaltonetworks.gp.pangps | |
launchctl kickstart -k gui/`id -u`/com.paloaltonetworks.gp.pangpa | |
##launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist | |
##launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist | |
echo "Done!" | |
;; | |
stop) | |
echo "Stopping GlobalProtect..." | |
sudo killall GlobalProtect | |
launchctl unload /Library/LaunchAgents/com.paloaltonetworks.gp.pangp* | |
#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