Created
March 18, 2021 16:22
-
-
Save pro4tlzz/57448e02b2bfadc8274ad7cd2c32c8b7 to your computer and use it in GitHub Desktop.
Google Chrome DM Token Folder Existence
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 "<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