Install-reboot-install

PhilS
New Contributor III

Is there a known good way to create a policy that includes a reboot in the middle of the process?
Situation: a piece of software cannot be cleanly updated, but must be uninstalled, the machine restarted, and only then have the new version installed. I want to make this a one-touch experience for my users if possible.
I've seen some things on some Linux sites that I might leverage but I'm hoping there's a wheel already invented. (And yes we are FileVault enabled so authenticated restart will be that middle step.)

3 REPLIES 3

sdagley
Esteemed Contributor II

@PhilS You can't do it with one policy, but you could have a phase 1 policy that does the removal and install a LaunchDaemon that is essentially a jamf policy -event Phase2Policy call before restarting. Then have a cleanup script in the Phase2Policy that removes the LaunchDaemon

PhilS
New Contributor III

@sdagley That's more or less what I was fearing. Looks like I get to write my first LaunchDaemon!!

sdagley
Esteemed Contributor II

@PhilS If you want some ideas take a look at https://github.com/kc9wwh/macOSUpgrade/blob/master/macOSUpgrade.sh which installs a LaunchDaemon to run a cleanup script after an OS upgrade.