Created
February 1, 2015 11:33
-
-
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
This file contains 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 characters
#!/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