Hey guys,
Looking to see if anyone has any idea on how to grab a particular item from the Spotlight plist file.
We are able to set the Spotlight settings via configuration profile, but now i need to use a script to check to see if the value is being managed or not. Since they seem to be in a dict, this is the part i am having trouble with.
if i check defaults read /Users/$loggeduser/Library/Preferences/com.apple.Spotlight, it spits out everything. I would like to grab only the values we are looking for,
{
enabled = 0;
name = "MENU_WEBSEARCH";
}
{
enabled = 0;
name = "MENU_SPOTLIGHT_SUGGESTIONS";
},
Here is what i have so far:
#!/bin/sh
loggeduser=`ls -l /dev/console | cut -d " " -f4`
SPOT=defaults read /Users/$loggeduser/Library/Preferences/com.apple.Spotlight | "grab X"
if [ $SPOT == "0" ]
then
:
else
jamf policy -trigger spotlight_config
fi
Thanks for looking.