Skip to content

Instantly share code, notes, and snippets.

@avinson
Last active May 4, 2016 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avinson/dbf7d7841cbd8c1a878e27a50c8b718e to your computer and use it in GitHub Desktop.
Save avinson/dbf7d7841cbd8c1a878e27a50c8b718e to your computer and use it in GitHub Desktop.
#!/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