Last active
May 4, 2016 23:34
-
-
Save avinson/dbf7d7841cbd8c1a878e27a50c8b718e to your computer and use it in GitHub Desktop.
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 | |
## | |
# Spotlight: Fix spotlight cpu issue | |
## | |
IFS=$'\n' | |
killspotlight="no" | |
if [ -e /Library/Managed\ Preferences/com.apple.Spotlight.plist ]; | |
then | |
echo "System: Spotlight Managed Pref Plist found. Removing..." | |
rm -rf /Library/Managed\ Preferences/com.apple.Spotlight.plist | |
killspotlight="yes" | |
fi | |
for i in `ls -d /Library/Managed\ Preferences/*/`; | |
do | |
if [ -e $i/com.apple.Spotlight.plist ]; | |
then | |
echo "System: Spotlight Managed Pref Plist found in $i Removing..." | |
rm -f $i/com.apple.Spotlight.plist | |
killspotlight="yes" | |
fi | |
done | |
if [ $killspotlight == "yes" ]; then killall Spotlight; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment