JAMFHelper.. What am I missing?

Millertime
New Contributor III

I have tested/tested and tested some more. Here's all I'm trying to do;

--Use JAMFHelper to put a message on the screen telling the users some magical/awesome stuff is happening (I've tried both with and without the -startlaunchd option)

--Have my shell script do the magical/awesome stuff, aka trigger a policy to run.

--Then kill JAMFhelper and move on. (with the -kill command)

The issue I'm having is, my script waits for jamfelper to close before ever moving on to the command to trigger the policy.

I'm WAYYY okay with looking silly, and someone telling me that I'm missing something very obvious, and I really hope that's all it is.

Thanks Everyone!

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

Since you didn't post your shell script here, I'm making the asumption that your jamfHelper piece is not being pushed to the background. Add an ampersand, "&", at the end of the line where you call jamfHelper. That allows the rest of your script to run and do your magical/awesome stuff to take place, not waiting for the OK button to be pressed.

Example:

#!/bin/bash
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility -description "Awesome stuff happening! Stand by..." -button1 "Coolio" -defaultButton 1 &

## do your magical/awesome stuff here
/usr/sbin/jamf policy -trigger awesomestuff

## now kill jamfHelper
killall jamfHelper 2> /dev/null

exit 0

Edit: If you aren't including a button in your jamfHelper message, the above will work the same, displaying a buttonless display., but killing it via your command when the policy is completed.

View solution in original post

2 REPLIES 2

mm2270
Legendary Contributor III

Since you didn't post your shell script here, I'm making the asumption that your jamfHelper piece is not being pushed to the background. Add an ampersand, "&", at the end of the line where you call jamfHelper. That allows the rest of your script to run and do your magical/awesome stuff to take place, not waiting for the OK button to be pressed.

Example:

#!/bin/bash
/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility -description "Awesome stuff happening! Stand by..." -button1 "Coolio" -defaultButton 1 &

## do your magical/awesome stuff here
/usr/sbin/jamf policy -trigger awesomestuff

## now kill jamfHelper
killall jamfHelper 2> /dev/null

exit 0

Edit: If you aren't including a button in your jamfHelper message, the above will work the same, displaying a buttonless display., but killing it via your command when the policy is completed.

Millertime
New Contributor III

Dude.... you rock!

Sorry for not posting an example. I almost did, but wasn't sure if that would be needed/helpful.

Thanks again, Mike!!!!