Created
March 18, 2021 16:23
-
-
Save pro4tlzz/0f2a31618cdc37c2ff1db2815d10a056 to your computer and use it in GitHub Desktop.
Remove Google Chrome Cloud DM Token Folder
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 characters
#!/bin/bash | |
loggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' ) | |
if [[ "$loggedInUser" == "root" ]]; then | |
echo "No user logged in" | |
exit | |
else | |
echo "$loggedInUser is logged in, proceeding" | |
fi | |
if [ -d /Users/$loggedInUser/Library/Application\ Support/Google/Chrome\ Cloud\ Enrollment ] | |
then | |
echo "Directory Cloud Enrollment exists" | |
rm -drv /Users/$loggedInUser/Library/Application\ Support/Google/Chrome\ Cloud\ Enrollment | |
else | |
echo "Directory Cloud Enrollment does not exist, exiting" | |
exit | |
fi | |
[ -d /Users/$loggedInUser/Library/Application\ Support/Google/Chrome\ Cloud\ Enrollment ] && echo "Directory Cloud Enrollment still exists." || echo "Directory Cloud Enrollment does not exist and was removed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment