-
-
Save mikemcduffie/a35ebf58ef0674041d19b6b0bbfb960b to your computer and use it in GitHub Desktop.
Revisions
-
christovic revised this gist
Jun 26, 2020 . 1 changed file with 14 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,27 @@ !/bin/bash launchctl stop com.apple.metadata.mds && launchctl start com.apple.metadata.mds vers=$( sw_vers | grep BuildVersion | awk '{print substr($2,0,2)}' ) sdir="/.Spotlight-V100" if [[ "${vers}" > "18" ]]; then sdir="/System/Volumes/Data${sdir}" fi cd "${sdir}" # First let's check if the directory we're adding already exists search_string=$1 let index="`plutil -extract Exclusions xml1 -o - VolumeConfiguration.plist | grep string | grep -wn "${search_string}" | cut -d ':' -f 1` - 1" if [ $index -lt 0 ]; then echo Not in array, let\'s add it in. plutil -insert Exclusions.0 -string ${search_string} "${sdir}/VolumeConfiguration.plist" else echo Already in array, not doing anything. fi # Now we restart mds to apply the changes -
christovic created this gist
May 22, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #!/bin/bash cd /System/Volumes/Data/.Spotlight-V100 # First let's check if the directory we're adding already exists search_string=$1 let index="`plutil -extract Exclusions xml1 -o - VolumeConfiguration.plist | grep string | grep -wn "${search_string}" | cut -d ':' -f 1` - 1" if [ $index -lt 0 ]; then echo Not in array, let\'s add it in. plutil -insert Exclusions.0 -string ${search_string} /System/Volumes/Data/.Spotlight-V100/VolumeConfiguration.plist else echo Already in array, not doing anything. fi # Now we restart mds to apply the changes launchctl stop com.apple.metadata.mds && launchctl start com.apple.metadata.mds