雖然GeekTool有很多功能對於個人使用者很有吸引力,但是在我們的網路環境中卻可能隨機造成使用者無法正常退出的問題,所以並不適用於網路使用者。雖然GeekTool的安裝包提供自己的程式刪除,但是是app程式,管理員在網路環境中,雖然可以先複製到目標機,然後運行一個Apple Script指令碼,最後刪除它,但是有點麻煩,所以根據自己的經驗,製作了下面是刪除指令碼,適合於通過ARD執行Unix命令而運行在網路內的所有機器,直接明了快捷。
#!/bin/bash<br />#<br />#--------------------------------------------------------------------------------------<br /># Remove Geektool<br />#--------------------------------------------------------------------------------------<br />sudo killall GeekTool<br />if test -e /usr/libexec/PlistBuddy ; then<br />ln -f /usr/libexec/PlistBuddy /usr/sbin/PlistBuddy<br />else<br />echo "No PlistBuddy utility found!"<br />exit 1<br />fi<br />sudo rm -fr /Library/PreferencePanes/GeekTool.prefPane<br />sudo rm -fr /Library/Preferences/org.tynsoe.geektool.plist<br />sudo rm -fr ~/Library/Preferences/org.tynsoe.geektool.plist<br />INDEX=0<br />FOUNDIT=false<br />while [ $INDEX -lt 100 ] ; do<br />GeekToolApp=`PlistBuddy 2>&1 -c "print :AutoLaunchedApplicationDictionary:$INDEX" /Library/Preferences/loginwindow.plist | grep "Does Not Exist"`<br />if [ "$GeekToolApp" = "" ]<br />then<br />GeekToolApp=`PlistBuddy -c "print :AutoLaunchedApplicationDictionary:$INDEX" /Library/Preferences/loginwindow.plist | grep "GeekTool"`<br />if [ "$GeekToolApp" = "" ]<br />then<br />echo "NOT found...$INDEX"<br />else<br />FOUNDIT=true<br />echo "Found and deleted GeekTool.app entry '$INDEX'" $FOUNDIT<br />PlistBuddy -c "delete :AutoLaunchedApplicationDictionary:$INDEX" /Library/Preferences/loginwindow.plist<br />break<br />fi<br />else<br />#echo "Reach the END of entry of loginwindow.plist"<br />break<br />fi<br />let INDEX=INDEX+1<br />done<br />exit 0
Tony Liu
Fall 2009 in Calgary