Automating Sierra Upgrade (JamfHelper Issue)

SeanNolan
New Contributor

Hi Everyone,

I'm trying to automate the upgrade of our Mac estate to Sierra, so far it does the following;

Policy No.1: Cache the installer to the Mac
(Mac is now part of a smart group 'Sierra Installer Cached')

Policy No.2: Run Script with JamfHelper window and custom Policy trigger

Policy No.3: Install the cached Sierra installer (triggered by the same script mentioned above).

The problem I'm having is with this script:

#!/bin/sh

######################################################
# Pop-Up Message to end users at Logout
######################################################

echo "Displaying Pop-Up for users..."
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -heading "Mac OS X Sierra Upgrade" -icon /Library/Wellcome/Icons/InstallAssistant.icns -alignDescription center -description "Your Mac is now being upgraded to Mac OS X Sierra, please leave your machine on overnight to allow enough time for the upgrade.

If you have any questions please contact the IT Service Desk on x8811"


######################################################
# Leave message on screen for 60 seconds
######################################################

echo "Waiting 60 seconds before triggering installation..."
wait 60

######################################################
# Kill JamfHelper
######################################################

echo "Quitting the Pop-Up window..."
killall jamfHelper


######################################################
# Trigger the final policy for the Sierra installer
######################################################

jamf policy -trigger SierraUpgrade


#
# At this stage the Jamf policy will kick in and complete the upgrade.
# Once the upgrade is finished, the machine will reboot back into the login window.

The jamfhelper works perfectly but the script never seems to progress from those lines. It seems to never get to the point of 'waiting' and killing the helper.

Any advice here is greatly appreciated!

Thanks!
Sean

3 REPLIES 3

mm2270
Legendary Contributor III

You should take a look at some existing scripts out there that do a pretty good job of automating the Sierra install/upgrade for starters. They may work a little better for you in general.
But to make my post a bit more useful, the problem is you need to add a & at the end of the first command that calls up jamfHelper or it will stay on that step until after it exits. The & tells the script to push that to the background and continue with the rest of the script.

grahamfw
New Contributor III

If you through an "&" at the end of your jamfHelper command, it will move on to the next thing without waiting for an exit code from that process.

Try this:

/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -heading "Mac OS X Sierra Upgrade" -icon /Library/Wellcome/Icons/InstallAssistant.icns -alignDescription center -description "Your Mac is now being upgraded to Mac OS X Sierra, please leave your machine on overnight to allow enough time for the upgrade.

If you have any questions please contact the IT Service Desk on x8811" & sleep 5 ; killall jamfHelper

That should kill it after 5 seconds.

SeanNolan
New Contributor

@mm2270 and @grahamfw - Thank you very much. This is now working well!