Posted on 07-05-2019 08:56 AM
does anyone have a script for updated macos. I have it being cashed on the user than deployed. I want a script that can prompt to install or delay. it currently only installs with out prompting.
Posted on 07-05-2019 09:42 AM
Are you looking to update macOS or upgrade macOS?
If you're just updating, you can use the build in Software Update policy payload. It can be triggered either periodically, or when a user selects it via Self Service.
Upgrading would be a little more complex, as you need to make sure that the installer is in /Applications/ and then call startosinstall.
Posted on 07-05-2019 10:04 AM
upgrade the OS, I have the installer going to the /applications folder. when I use the install policy from Chashe on system it just reboots and installs. would like a warning or prompt to delay or let them closer there apps that are open
Posted on 07-06-2019 03:50 AM
Posted on 07-08-2019 08:43 AM
I have the script set and the Mojove in the applications folder. but the script does not run correct get an error "unapproved caller"
Posted on 07-11-2019 10:23 AM
@jranchuk , you set all the parameters in the policy, based off the script variables? The last time I've seen an Unapproved Caller error, was due to the computer itself. May have to boot into safe mode, then restart boot as normal.
Posted on 07-15-2019 06:04 AM
I have a very basic script that allows option to delay or update now with a gui but it's not perfect, have been meaning to get round to improving this but was in a pinch and this was quick and easy to implement. we run this on machines on outdated OS' once a day to prompt the user to update.
Hope this helps
#!/bin/bash
osvers=$(sw_vers -productVersion)
dialog="Your MacOS version is $osvers, and needs to be updated the latest version which is 10.14.5."
dialog2="Youe Mac is now updating. Please do not shutdown or restart. Your Mac will automatically reboot, the process may take upto an hour. Please save any unsaved work and close open applications"
description=`echo "$dialog"`
description2=`echo "$dialog2"`
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
title="Message from Wellcom IT"
icon="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Sync.icns"
icon2="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Clock.icns"
heading="Updates Required"
heading2="Please wait..."
button1="Update"
button2="Cancel"
RESULT=$("$jamfHelper" -windowType utility -title "$title" -description "$description" -icon "$icon" -iconSize 240 -heading "$heading" -button1 $button1 -button2 $button2 -showDelayOptions "0, 300, 3600, 86400" -timeout)
if [ $RESULT == 1 ]; then
"$jamfHelper" -windowType utility -title "$title" -description "$description2" -icon "$icon2" -iconSize 240 -heading "$heading"
"/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall" --agreetolicense --nointeraction
elif [ $RESULT == 3001 ]; then
sleep 300
"$jamfHelper" -windowType utility -title "$title" -description "$description2" -icon "$icon2" -iconSize 240 -heading "$heading"
"/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall" --agreetolicense --nointeraction
elif [ $RESULT == 36001 ]; then
sleep 3600
"$jamfHelper" -windowType utility -title "$title" -description "$description2" -icon "$icon2" -iconSize 240 -heading "$heading"
"/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall" --agreetolicense --nointeraction
elif [ $RESULT == 864001 ]; then
sleep 86400
"$jamfHelper" -windowType utility -title "$title" -description "$description2" -icon "$icon2" -iconSize 240 -heading "$heading"
"/Applications/Install macOS Mojave.app/Contents/Resources/startosinstall" --agreetolicense --nointeraction
elif [ $RESULT == 2 ]; then
echo "Cancel"
else "failed"
fi
Posted on 07-15-2019 01:04 PM
@anayat.chowdhury
thank you for the script, it work but will not until reboot it just keep the popup window "updates Required"
the auto reboot not working the MacBook OS is High Sierra.