Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
For Reposado: Removes config-data attribute from selected update types: XProtectPlistConfigData, Gatekeeper Configuration Data
#!/bin/bash
# remove_configdata_from_selected
#
# removes config-data attribute from selected update types: XProtectPlistConfigData, Gatekeeper Configuration Data
reposadoUser=reposado
reposadoGroup=admin
reposadoDir="/path/to/your/reposado"
repoUtilCmd="/path/to/your/reposado/code/repoutil"
###
# functions
function logTyper () {
timeStamp=$(date '+%h %d %T')
echo "${timeStamp}: ${1}"
}
###
# actions
if ! [ -r "${repoUtilCmd}" ]; then
logTyper "'${repoUtilCmd}' not found"
exit 1
fi
logTyper "Checking for updates for config-data removal..."
listSysConfigUpdates=$("${repoUtilCmd}" --products | egrep 'XProtectPlistConfigData|Gatekeeper Configuration Data' | grep -v '(Deprecated)')
OLD_IFS=${IFS}
IFS=$'\n'
# process suitable updates
for item in ${listSysConfigUpdates}
do
itemID=$(echo "${item}" | awk '{print $1}')
if [ "" == "${itemID}" ]; then
continue
fi
"${repoUtilCmd}" --remove-config-data "${itemID}"
done
# correct file permissions if needed
# echo "Setting file permissions..."
# chown -R "${reposadoUser}" "${reposadoDir}"
# chgrp -R "${reposadoGroup}" "${reposadoDir}"
# chmod -R ug+rwX,o-w,a+rX "${reposadoDir}"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.