Created
January 9, 2023 08:01
-
-
Save pr0PM/732e6aa68c8bdb553535d6716ac9943b to your computer and use it in GitHub Desktop.
script to start/stop palo alto vpn since reconnecting takes longer and is slower if done from menu bar icon
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 | |
# todo: original credits | |
function setup() { | |
sudo mv /Library/LaunchDaemons/com.paloaltonetworks.gp.pangpsd.plist /Library/Application\ Support/PaloAltoNetworks/GlobalProtect/ | |
sudo mv /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist /Library/Application\ Support/PaloAltoNetworks/GlobalProtect/ | |
sudo mv /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist /Library/Application\ Support/PaloAltoNetworks/GlobalProtect/ | |
} | |
function up() { | |
launchctl load /Library/Application\ Support/PaloAltoNetworks/GlobalProtect/com.paloaltonetworks.gp.pangps.plist | |
launchctl load /Library/Application\ Support/PaloAltoNetworks/GlobalProtect/com.paloaltonetworks.gp.pangpa.plist | |
} | |
function down() { | |
launchctl remove com.paloaltonetworks.gp.pangps | |
launchctl remove com.paloaltonetworks.gp.pangpa | |
} | |
case $1 in | |
up) | |
echo "Launching global protect" | |
up | |
;; | |
down) | |
echo "Quitting global protect" | |
down | |
;; | |
setup) | |
echo "Disabling global protect from startup items" | |
setup | |
;; | |
*) | |
echo "'$1' is not a valid verb. The only valid verbs are 'up' and 'down'." | |
exit 1 | |
;; | |
esac% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment