SANSUI'S BLOG

系统外观
分类标签
RSS
Sansui 2023
All rights reserved
人活着就是为了卡卡西
2020 年 3 月 27 日

GlobalProtect启动退出脚本(MAC)

mac上的Global Protect近似于流氓软件,但迫于学校要求不得不用。于是写了个shell脚本。

参考:Mac 退出与卸载 GlobalProtect

if [ $# -eq 0 ]; then exit 0;fi

case "$1" in
	-h|--help) 
		echo "-l	launch";
		echo "-k	kill";
		echo "-as	launch and set autostart";
		echo "-uas	kill and unset autostart";
		echo "-h	help";
		exit 0;;
	-k)
		launchctl unload /Library/LaunchAgents/com.paloaltonetworks.gp.pangp*;exit 0;;
	-l)
		launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangp*;exit 0;;
	-uas)
		launchctl unload -w /Library/LaunchAgents/com.paloaltonetworks.gp.pangp*;exit 0;;
	-as)
		launchctl load -w /Library/LaunchAgents/com.paloaltonetworks.gp.pangp*;exit 0;;
esac

在/usr/local/bin下新建文件,输入以上内容,并赋予执行权限即可。

更新于 2020-03-27 08:00
Waline