Created
May 10, 2015 02:29
-
-
Save kitzy/e1ee9d5f4e43bf184e3e to your computer and use it in GitHub Desktop.
This gist checks to see if JSS enrollment is complete, and attempts to force enrollment until sucessful.
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 | |
# Check to make sure the machine has enrolled before continuing | |
/bin/echo "Checking enrollment..." | |
until [ ! -f "/Library/Application Support/JAMF/FirstRun/Enroll/enroll.sh" ] | |
do | |
/bin/echo "Machine is not enrolled. Trying enrollment." | |
# Attempt enrollment | |
/Library/Application\ Support/JAMF/FirstRun/Enroll/enroll.sh | |
# Test if enrollment completed, sleep and try again if not | |
if [ ! -f "/Library/Application Support/JAMF/FirstRun/Enroll/enroll.sh" ] | |
then | |
break | |
else | |
sleep 30 | |
fi | |
done | |
/bin/echo "Enrollment complete" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment