Skip to content

Instantly share code, notes, and snippets.

@mallej
Last active January 29, 2018 16:16
Show Gist options
  • Save mallej/43cce9cd82a41bf055421731fb9560b6 to your computer and use it in GitHub Desktop.
Save mallej/43cce9cd82a41bf055421731fb9560b6 to your computer and use it in GitHub Desktop.
[macOS - restart reboot] #macos #dialog #applescript #jamf
# https://www.jamf.com/jamf-nation/discussions/16614/reboot-machines#responseChild97418
jamf reboot -minutes 10 -message "Your Mac will reboot in 10 minutes to maintain smooth working order. Please close any open work now to avoid data loss of unsaved documents." -background
# shows macOS restart dialog window
# http://macscripter.net/viewtopic.php?pid=173582#p173582
osascript -e 'tell app "loginwindow" to «event aevtrrst»'
# https://www.jamf.com/jamf-nation/discussions/26886/way-to-gracefully-restart-a-mac-from-the-jamfhelper-windows#responseChild159625
# If you need to put a restart in your script, you can give it a slight delay and send it to a background process using something like:
shutdown -r +1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment