Mac OS X: 彻底删除GeekTool(bash脚本)

虽然GeekTool有很多功能对于个人用户很有吸引力,但是在我们的网络环境中却可能随机造成用户无法正常退出的问题,所以并不适用于网络用户。虽然GeekTool的安装包提供自己的程序删除,但是是app程序,管理员在网络环境中,虽然可以先复制到目标机,然后运行一个Apple Script脚本,最后删除它,但是有点麻烦,所以根据自己的经验,制作了下面是删除脚本,适合于通过ARD执行Unix命令而运行在网络内的所有机器,直接明了快捷。

#!/bin/bash # #-------------------------------------------------------------------------------------- # Remove Geektool #-------------------------------------------------------------------------------------- sudo killall GeekTool if test -e /usr/libexec/PlistBuddy ; then ln -f /usr/libexec/PlistBuddy /usr/sbin/PlistBuddy else echo "No PlistBuddy utility found!" exit 1 fi sudo rm -fr /Library/PreferencePanes/GeekTool.prefPane sudo rm -fr /Library/Preferences/org.tynsoe.geektool.plist sudo rm -fr ~/Library/Preferences/org.tynsoe.geektool.plist INDEX=0 FOUNDIT=false while [ $INDEX -lt 100 ] ; do GeekToolApp=`PlistBuddy 2>&1 -c "print :AutoLaunchedApplicationDictionary:$INDEX" /Library/Preferences/loginwindow.plist | grep "Does Not Exist"` if [ "$GeekToolApp" = "" ] then GeekToolApp=`PlistBuddy -c "print :AutoLaunchedApplicationDictionary:$INDEX" /Library/Preferences/loginwindow.plist | grep "GeekTool"` if [ "$GeekToolApp" = "" ] then echo "NOT found...$INDEX" else FOUNDIT=true echo "Found and deleted GeekTool.app entry '$INDEX'" $FOUNDIT PlistBuddy -c "delete :AutoLaunchedApplicationDictionary:$INDEX" /Library/Preferences/loginwindow.plist break fi else # echo "Reach the END of entry of loginwindow.plist" break fi let INDEX=INDEX+1 done exit 0

Tony Liu

Fall 2009 in Calgary

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值