Closed pro4tlzz closed 1 year ago
Had a quick read through the code base, Exit code 1 is supposed to be returned for power check failures https://github.com/grahampugh/erase-install/blob/main/erase-install.sh#L1428
Another example for free disk space https://github.com/grahampugh/erase-install/blob/main/erase-install.sh#L305
As explained in Slack, the Run Processes field always returns 0. There is a PR open which provides an example script for adding to your Jamf policy to run erase-install.sh from the package with parameters: https://github.com/grahampugh/erase-install/pull/257
I'll take a look at this over the next few days and decide whether to support the script. I think it might be necessary for those of you that care about the exit status.
As explained in Slack, the Run Processes field always returns 0. There is a PR open which provides an example script for adding to your Jamf policy to run erase-install.sh from the package with parameters: #257
I'll take a look at this over the next few days and decide whether to support the script. I think it might be necessary for those of you that care about the exit status.
Thanks.
I've had a look and I like the idea of a launcher script aswell, I could just copy pasta my files and processes commands into a simple script but when it comes to helping people its easier if everyone used a standardised script for running erase-install
I have incorporated #257 into the pre-release of 27.0. Please test out the launcher script and see if it solves your issue.
Thank you! I'll definitely test
This works great
Added the launcher script to Jamf Pro
Executed from a device without power and a failure is returned
I use erase-install with Jamf Pro. I deploy a self service policy for OS upgrades using erase-install and I specify a power source needs to be connected. I do this with
--check-power
The problem is if a power source isn't found erase-install doesn't return an exit code on completion. As a result of this Jamf Pro shows the policy as 'Completed'. Ideally one would rather see 'Failed'erase-install is supposed to return an exit code (1) which indicates a failure if a condition such as the requirement for a power source or free disk space fails.
Here is an example of the current exit code (0) when the power source condition fails
I've tested with erase-install v26.0 so obviously I should update my pkg as well