Skip to content

Instantly share code, notes, and snippets.

@pro4tlzz
Created March 18, 2021 16:22
Show Gist options
  • Save pro4tlzz/57448e02b2bfadc8274ad7cd2c32c8b7 to your computer and use it in GitHub Desktop.
Save pro4tlzz/57448e02b2bfadc8274ad7cd2c32c8b7 to your computer and use it in GitHub Desktop.
Google Chrome DM Token Folder Existence
#!/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 "<result>"Directory Cloud Enrollment exists"</result>"
else
echo "<result>"Directory Cloud Enrollment does not exist, exiting"</result>"
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment