jamfHelper FirstStart suppression

acdesigntech
Contributor II

SO I've been working on a script to run on FirstStart that "suppresses" jamf's jamfHelper with a jamfHelper of my own, customized and controlled exactly the way I want. I'm currently using this for my 10.8 imaging as the entire upheaval of almost every Mac workflow here is a great opportunity for me to tear down our Mac management infrastructure and start fresh (excepting what I'VE put in place of course :P ).

I keep running into a crappy boot loop if I specify for this script to reboot the box. If I do not, it just sits at the "enter an Apple ID" prompt since JAMF's process was interrupted with the whole automated login thing it does on FirstRun. If i log in manually, it finishes what it was doing, and reboots never to cause an issue again. I don't want that for obvious reasons. I THINK that just allowing this script to exit gracefully will cause the jamf firstRun package to continue normally. Am I correct? There's probably a better way to do this, but I'm not sure how since enrollment doesn't happen until reboot after imaging. Maybe a daemon? Not sure how to install one on a non-boot volume.

#!/bin/sh

#########################################
#                                       #
# CasperPostImage.sh                    #
# Written by Andrew Caldwell 9/21/2012  #
#                                       #
#########################################

PostInstallTrigger=( 'InstallAdbeDesStd' 'InstallFlashPlayer' 'InstallFlip4Mac' 'InstalliPhoto' 'InstallMSOffice' 'InstallComboUpdate' 'InstallJava' 'InstallUTC' 'InstallSEP' 'ConfigureSystemSettings' )

fJAMFHelper ()
{
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -heading "American Greetings ISD is finishing the imaging process" -description "We are finalizing the image on this computer. It will send a completion email to you and reboot when finished. Now performing action: ${PostInstallTrigger[$i]}." -icon /Library/Application Support/JAMF/EndUserSupport/AGRose.icns > /dev/null 2>&1 &
}

/usr/sbin/jamf policy -trigger InstallISDToolset &  
## Get the Process ID of the last comand run in the background ($!)
PID=`echo "$!"`
wait $PID

## For each PostInstall trigger above, trigger the corresponding JAMF policy. We are going to do some magic by sending the trigger text to jamfHelper as a way of providing feedback to the imaging tech on what the imaging process is actually doing. 
for (( i = 0; i < ${#PostInstallTrigger[@]} ; i++ ))
do
    /usr/sbin/jamf policy -trigger "${PostInstallTrigger[$i]}" &
    ## Get the Process ID of the last comand run in the background ($!)
    PID=`echo "$!"`
    fJAMFHelper
    wait $PID
done


## Kill all the jamfHelper processes we've spawned 
##killall jamfHelper

## Ensure the computer reboots
## reboot

exit 0
1 REPLY 1

acdesigntech
Contributor II

That and I can't seem to get the '${PostInstallTrigger[$i]}' to show properly in jamfHelper, so instead of "Now performing action: InstallAdobeCS4DesStd." I get "Now performing action: ${PostInstallTrigger[$i]}."