jamfHelper for a reboot on policy installs

sanaumann
New Contributor III

Hello, JAMFers.

I am working on a couple policy pushes that require reboots.

In order to not flip out my user base, I would like to have these reboots give the user the option to wait 60 minutes when they first get the policy applied . . . so they would get a pop-up saying, "You need to save your work and reboot - BUT you can put this off for 60 minutes and do the reboot in an hour."

I've been using JamfHelper to write the script, but all I have is a shell. I can make the reboot now piece work, I just don't know how to make the reboot later part work. Any help would be so much appreciated as I am a novice scripter in the Apple world.

Thanks, all.
Sarah

2 REPLIES 2

mm2270
Legendary Contributor III

@sanaumann Sarah, this is certainly possible to do, but are you looking to hard code it so it will set the reboot for 1 hour ahead without user interaction, or do you want them to choose between rebooting immediately or 1 hour later? Either way can be done, but the approach could look different.

Also, shameless plug, but you can look at one of my scripts on github, called "reboot_scheduler" It lets you pass some parameters to the script or hardcode values in that will let the end user choose between a few different reboot delay options. What they select will create a new LaunchDaemon with a future reboot set for exactly the number of minutes chosen in the future. You can also use the script to pass a value of 60 (minutes) to auto set up a reboot 60 minutes in advance, and it will show a dialog letting them know its been set and exactly when their Mac will reboot.
The only thing is, the script requires the use of cocoaDialog, an old and mostly unsupported 3rd party tool, which, miraculously still basically works even under El Capitan. Since its not built into the OS or deployed as part of JAMF's toolset, it would mean you have to push that to each machine in a separate policy.
Still, if you want to at least look at it, you can find that here

sanaumann
New Contributor III

Hi, @mm2270.

I'd like to give them the option of rebooting now or rebooting in one hour. The built-in reboot options on Casper leave much to be desired.