Upgrade to OSX Mojave | Self service

Rohitds14
New Contributor III

Hi JamfNation.
I am upgrading macOSX to Mojave from Self Service click with 2 consecutive policies,But somehow the os is upgrading to Mojave fine but i am not getting any logs. all the targets are showing as 'pending'.
Here are the policy details:

~Policy 1: criteria check
scope: Selected macs
execution: ongoing (Self service)
maintenance: inventory
script: added (before)
this scripts few prerequisite checks like, Diskspace check, battery%, Ac power, Dependant Apps etc.
If all the criteria matches then it will trigger the next policy
sudo jamf policy -trigger <next policy>
in case the criteria doesnt match, it will pop a message like,
"try again with AC power cable attached" or
"your battery is too low for OSX upgrade" etc.

~Policy 2: install OSX
scope: All mac
execution: custom trigger
Package: OSX installer
Restart: if package require with 2 min delay
maintenance: inventory
script: added (after)

#!/bin/sh
osascript -e 'display notification "Please keep your mac idle for some time" with title "Greetings from IT" subtitle "Your OS is installing..."'

sudo killall "Self Service"
sudo /Applications/Install macOS Mojave.app/Contents/Resources/startosinstall --agreetolicense
sudo systemsetup -setcomputersleep 60
sudo systemsetup -setdisplaysleep 60
sudo rm -rf /Applications/Install macOS Mojave.app


exit 0      ## Success
exit 1      ## Failure

Now, i have tried with 2 macs they are upgrading fine to OSX 10.14.6 (jamf also showing this osx version)
But for both the policies the targets are showing as 'pending'
Is there a better way to follow, i would like to know if i am missing something.
cheers!!

2 REPLIES 2

shaquir
Contributor III

Check out this macOS Update Guide from HCS
This script is commonly used for macOS upgrades

If you need to output the results you need to use echo in your script or output to a log file.

/bin/echo "This was the result"

gabester
Contributor III

@Rohitds14 sadly I think this may be the way “it just works” now... all my security updates come through as failed in my environment because we do not allow Macs to connect the network without a user logon.

I’ve been hoping to get the time to engineer some elaborate workaround likely involving EAs and flag files and detection scripts and multiple policies... but there are higher priorities. I can accept a failed or pending result so long as I can see that Mac has actually updated. I just scope these deployments to smart groups and then frequently re-add them in the policies to get current counts of what is left to be updated.