Created
September 26, 2013 20:01
-
-
Save arubdesu/6719745 to your computer and use it in GitHub Desktop.
straight from DeployStudio's /Applications/Utilities/DeployStudio\ Admin.app/Contents/Frameworks/DSCore.framework/Versions/A/Resources/Tools/Common/ds_auto_enroll/ds_auto_enroll.sh
This file contains 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/sh | |
# disable history characters | |
histchars= | |
SCRIPT_NAME=`/usr/bin/basename "${0}"` | |
echo "${SCRIPT_NAME} - v1.0 ("`date`")" | |
SSL_FILE=`echo "${0}" | sed s/\.sh$/_ssl\.mobileconfig/` | |
BOOTSTRAP_FILE=`echo "${0}" | sed s/\.sh$/_bootstrap\.mobileconfig/` | |
# | |
# Import trust profile first | |
# | |
if [ -e "${SSL_FILE}" ] | |
then | |
profiles -I -F "${SSL_FILE}" | |
fi | |
# | |
# Import enrollment profile | |
# | |
if [ -e "${BOOTSTRAP_FILE}" ] | |
then | |
profiles -I -F "${BOOTSTRAP_FILE}" | |
if [ ${?} -ne 0 ] | |
then | |
echo "Auto enrollment failed, will retry on next boot!" | |
exit 1 | |
fi | |
fi | |
# | |
# Self removal | |
# | |
/usr/bin/srm -mf "${0}" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment