Help with script deployment

dudzikj
New Contributor III

Hi all,

With High Sierra released, I am testing deployment via the startosinstall command. I am using a script to initiate an unattended install that I found in this article: https://www.jamf.com/blog/streamlining-your-macos-upgrade-process/

The only modification I have made to the script is to change it so that it looks for a High Sierra installer, rather than a Sierra installer. So basically I want jamfHelper to show a warning message, and then the installer does its thing.

I have set up a policy to deploy the installer, and then I send the script, either in the same policy, or as a separate policy (I am figuring on caching the installer on my machines in advance, and then running the script at a later, convenient time). Ideally, I will send both policies via recurring check-in, which is what I have been testing.

For whatever reason, the script runs, but doesn't do anything if I just let the machines check in on their own. If I initiate check-in from Terminal, it works flawlessly. If I send the script via Casper Remote, it works every time. But I have not seen it do anything when I just let the check-in happen on its own. This is both on machines that are logged in and sitting at the desktop, and machines that are logged out and sitting at the login prompt.

I have tried isolating just the jamfHelper components of the script, and just the part that launches the installer, and all of those variations fail as well. I even tried packaging up an executable version of the script, deploying it to the machine, and then sending a script to launch the script locally. Same thing. As long as I manually trigger the policy, it works fine, but no dice otherwise.

I do this kind of stuff all the time, where I bury something in a folder somewhere and then launch it after via a script (the Adobe serializer leaps to mind), so I know it can be done, and I've gone over those scripts just to make sure I'm not missing something obvious.

Does anybody have any thoughts as to why this is happening? I'm prepared for it to be something really obvious, because I've tried every convoluted way to get it to work that I can think of...

For reference, here is the script:

 #!/bin/bash

#Heading to be used for jamfHelper"

heading="Please wait as we prepare your computer for macOS Sierra..."

#Title to be used for jamfHelper

description="

This process will take approximately 5-10 minutes.

Once completed your computer will reboot and begin the upgrade."

#Icon to be used for jamfHelper

icon=/Users/Shared/Install macOS High Sierra.app/Contents/Resources/InstallAssistant.icns

#Launch jamfHelper

/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType fs -title "" -icon "$icon" -heading "$heading" -description "$description" &

jamfHelperPID=$(echo $!)

#Start macOS Upgrade

/Users/Shared/Install macOS High Sierra.app/Contents/Resources/startosinstall --volume / --applicationpath /Users/Shared/Install macOS High Sierra.app --nointeraction --pidtosignal $jamfHelperPID &

exit 0
1 ACCEPTED SOLUTION

dudzikj
New Contributor III

Strange. All of the bolded print in the code should be commented lines with a pound sign. I'm not sure how to get it not to make it look like bold print.

Figured it out.

View solution in original post

1 REPLY 1

dudzikj
New Contributor III

Strange. All of the bolded print in the code should be commented lines with a pound sign. I'm not sure how to get it not to make it look like bold print.

Figured it out.