01-18-2022 12:11 PM - edited 01-18-2022 12:12 PM
I am trying to build out a jamf helper notification that will allow me to let users select a time in the drop down and use that time to delay when update are force installed.
The bolded statement is what needs to be changed so that I can do something like:
sudo DELAY???+${timeMinutes} softwareupdate -i -a
Not really sure what my options would be here.
Currently I'm trying to adapt a JAMFHelper script I use to force reboots:
selection=$("/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper" -windowType "$window" -title "$title" -heading "$heading" -alignHeading center -description "$description" -icon "$icon" -button2 "Delay Restart" -showDelayOptions "600, 1800, 3600, 7200, 14400, 28800, 43200, 86400, 172800" -button1 "Restart Now" -cancelButton 2 -defaultButton 2)
buttonClicked="${selection:$i-1}"
timeChosen="${selection%?}"
# Convert seconds to minutes for restart command
timeMinutes=$((timeChosen/60))
# Echoes for troubleshooting purposes
echo "Button clicked was: $buttonClicked"
echo "Time chosen was: $timeChosen"
echo "Time in minutes: $timeMinutes"
if [[ "$buttonClicked" == "2" ]] && [[ ! -z "$timeChosen" ]]; then
echo "Restart button was clicked. Initiating restart in $timeMinutes minutes"
shutdown -r +${timeMinutes}
elif [ "$buttonClicked" == "1" ]; then
echo "Cancel button clicked. Exiting..."
shutdown -r now
Posted on 01-18-2022 12:14 PM
Take a look at this: GitHub - mpanighetti/install-or-defer.
Posted on 01-19-2022 06:54 AM
This has been a great resource. https://babodee.wordpress.com/2021/03/30/handling-major-upgrades-and-minor-updates-for-macos-with-ja...