I'm trying to add a warning to our Big Sur installer in Self Serve. I have the policy set to make sure users have to view the description, but that doesn't seem to be enough.
I've made a script with jamfHelper. It's a simple warning message to back up important files to our Google Drive before continuing, with a button to cancel and a button to continue.
In the policy, this warning is set to run "Before". The policy is working correctly, giving me the warning before trying to run the erase-install (grahampugh) script. However, I can't seem to get the Cancel button to actually halt the policy execution..
Can this be done? This is what I have so far.
RESULT=$("$jamfHelper" -windowType hud -title "Before you continue... Warning from the HelpDesk" -icon "$jamfIcon" -heading "$heading" -description "$description" -button1 "Cancel" -button2 "I understand." -defaultButton 1 -lockHUD -iconSize 200)
if [ "$RESULT" == 0 ]; then
# do button1 stuff
echo "Cancel was pressed!"
echo "error: script failed"
exit 1
elif [ "$RESULT" == 2 ]; then
# do button2 stuff
echo "OK was pressed!"
exit 0
fi
exit 1