Skip to content

Instantly share code, notes, and snippets.

@MiqViq
Created February 1, 2015 11:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiqViq/4dbe0210671aa80b2e8c to your computer and use it in GitHub Desktop.
Save MiqViq/4dbe0210671aa80b2e8c to your computer and use it in GitHub Desktop.
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