Skip to content

Instantly share code, notes, and snippets.

@pro4tlzz
Created March 18, 2021 16:23
Show Gist options
  • Save pro4tlzz/0f2a31618cdc37c2ff1db2815d10a056 to your computer and use it in GitHub Desktop.
Save pro4tlzz/0f2a31618cdc37c2ff1db2815d10a056 to your computer and use it in GitHub Desktop.
Remove Google Chrome Cloud DM Token Folder
#!/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