Skip to main content
Question

scripting with jamfhelper and jamf binary


Forum|alt.badge.img+5

i have an applescript / shell script combi that puts up the jamfhelper screen while it calls the policies, but the 'do shell script jamf policy' runs as a sub process from the applescript, thus while this is running, the applescript continues, even though the policies are still running, eg software install.

I've looked at various methods of tying to monitor the jamf process / cpu usage, but i'm not getting that far..

any suggestions?

all i need is for the jamfhelper screen to come on, policies run, jamfhelper screen is removed.

thanks.

3 replies

dpertschi
Forum|alt.badge.img+19
  • Contributor
  • 459 replies
  • August 1, 2013

What does the AppleScript do? I'd separate out jamfhelper from whatever your doing with AppleScript.

That part aside, you can simply add a Before script to your policy which triggers jamfhelper and then terminate the jamfhelper process after the policy runs by using the Run Command on the Advanced tab of the policy.


Forum|alt.badge.img+5

Hi,

thanks for the reply, the applescript provides a means for entering asset / building / room info after imaging, then applying policies, its interactive.. the jamfhelp is being used to provide feedback... at some point i'll get cocadialog into the mix.. but this will do for now..

this is what I came up with.. and.. it works.. for me.. i'm sure there 101 better ways.. but..

---
do shell script "jamf policy > /dev/null 2>&1 & echo $!" password "damnitshottoday" with administrator privileges

set pid to the result
repeat set loop to do shell script "ps aux | grep " & pid & " | grep -v grep | awk '{print$1}'" if loop is "" then exit repeat
end repeat
display dialog "foo" --this isn't really what is does at the end..
---


Forum|alt.badge.img+5

ok.. so this doesn't 'quite' work after all..


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings