Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jeket/a33c6f9579ecc5f968a1bbd0dbbead84 to your computer and use it in GitHub Desktop.
Save Jeket/a33c6f9579ecc5f968a1bbd0dbbead84 to your computer and use it in GitHub Desktop.
forcefully_remove_mdm_1015.sh
#!/bin/bash
# Seriously there still apparently aren't enough warning labels
# If you don't understand the consequences don't do it
REMOVE_PATHS=( # "/var/db/ConfigurationProfiles/.passcodePolicesAreInstalled"
# "/var/db/ConfigurationProfiles/.cloudConfigHasActivationRecord"
# "/var/db/ConfigurationProfiles/.cloudConfigNoActivationRecord"
# "/var/db/ConfigurationProfiles/.cloudConfigProfileObtained"
# "/var/db/ConfigurationProfiles/.cloudConfigRecordFound"
# "/var/db/ConfigurationProfiles/.profilesAreInstalled"
# "/var/db/ConfigurationProfiles/MDM_ComputerPrefs.plist"
# "/var/db/ConfigurationProfiles/Setup"
"/var/db/ConfigurationProfiles/Store"
"/Library/Keychains/apsd.keychain"
)
for removePath in "${REMOVE_PATHS[@]}"
do
if [ -e "$removePath" ]; then
printf "Deleting: %s\n" "$removePath"
rm -rf "$removePath"
else
printf "Not found: %s\n" "$removePath"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment