Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Last active October 25, 2022 23:30
Show Gist options
  • Save talkingmoose/3d405eb9dc8ce99a48cda9d9f7609a4f to your computer and use it in GitHub Desktop.
Save talkingmoose/3d405eb9dc8ce99a48cda9d9f7609a4f to your computer and use it in GitHub Desktop.
Example of a countdown dialog that can be added to a Jamf Pro policy using a Before script to alert users that something will happen and give them a visual cue that time is running out. Ideal for policies that need to upgrade software such as macOS after gentle reminders and notifications have failed to get their attention.
#!/bin/bash
# Displays a dialog to the end user with a five minute countdown. If the countdown reaches 0:00 or the user clicks the button, the dialog disappears allowing the remainder of the workflow to proceed.
/Library/Application\ Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper \
-windowType utility \
-lockHUD \
-title "macOS Mojave Upgrade" \
-heading "ALERT: Your upgrade is about to start!" \
-description "Your Mac will automatically upgrade its operating system in five minutes and can no longer be deferred. Close and save your work now.
This process will take about an hour and your computer may restart multiple times. Leave your computer connected to power and do not move or close your laptop.
To begin the upgrade immediately, press the 'Upgrade Now' button." \
-icon "/Applications/Install macOS Mojave.app/Contents/Resources/InstallAssistant.icns" \
-iconSize 256 \
-button1 "Upgrade Now" \
-defaultButton 1 \
-countdown \
-timeout 300 \
-alignCountdown right
exit 0
@talkingmoose
Copy link
Author

Example dialog:

countdowndialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment