I am frequently tasked with updating the many agents we run on our Macs. Often, the update process does not involve simply running a package that would register a failure if the policy failed to run the install for some reason. If the update process is driven entirely by a script, and the update is not a success, Jamf Pro will show that the policy completed. It did actually complete but the update was a failure. When I noticed that this was happening with one of my recent updates, I added a conditional statement to check if the version of the app was the newer version.
if [ $Version = "7.13" ]; then
echo "Upgrade to version 7.13 was successful"
exit 0
else
echo "Upgrade to version 7.13 failed"
exit 1
fi
Since I have noticed that some Macs did not get the latest version of the app and the policy shows as completed, I'm obviously not doing this right. What else do I need to do to get Jamf Pro to show the policy as failed instead of completed?