Skip to main content
Question

Self Service - open script in Terminal


mhasman
Forum|alt.badge.img+22
  • Valued Contributor
  • 426 replies

Hi all,

Is there any way to make the policy in Self Service which opens Terminal, then runs uploaded to JSS script - so user can see the execution process?

Thanks!
- Mark

6 replies

davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • 1811 replies
  • July 21, 2016

Scripts are normally silent but there's a few ways you could let the user see what's going on:

  • Save the script file locally with the .command extension and have the self service policy open the file
  • Have the result of the script echo out to jamfhelper
  • Direct the user to /var/log/jamf.log to see the activity

Hopefully one of these options would suit.


Forum|alt.badge.img+16
  • Valued Contributor
  • 1002 replies
  • July 21, 2016

I have a few scripts where I echo out the results to a log file then open the log file on completion.
Doesn't let them see it in action, but it does let them see the results.
If your wanting to pass progress to the user the OS X notifications are quite good as well.

osascript 2>/dev/null <<NOTIFY_USER
tell Application "Finder"
display notification "Some Information" with title "Some Title"
end tell
NOTIFY_USER

Forum|alt.badge.img+10
  • Contributor
  • 207 replies
  • July 21, 2016

You could use JAMFhelper or cocoaDialog to show popup windows or notification bubbles during the installation.

JAMFhelper syntax: In Terminal, type:

sudo /Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -help

cocoaDialog URL


mhasman
Forum|alt.badge.img+22
  • Author
  • Valued Contributor
  • 426 replies
  • July 21, 2016

Thank you!
Yes, we use cocoaDialog for other solutions. For that particular one the scenario is to open terminal on end-user's side, start the script and get user puts something. user's entrances could not be collected as parameters before script started.


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • July 21, 2016

@mhasman Is it truly a requirement that the script be run in Terminal with user input? Is it possible to use something like cocoaDialog or Applescript to ask for input, then pass that as a captured variable to the script being run?
While its not impossible to do what you're asking for with it running in Terminal, I would think for an easier overall experience, it would be better to have a simple input box come up asking for some information and then using that in the script as described above.

If you really need the script to run as the user, you might need to package up the script itself and deploy it to something like /tmp/ and then have your policy run the script from that location as the user in Terminal. Again, all possible, but seems overly complicated if you just need them to enter something at some point in the process.


mhasman
Forum|alt.badge.img+22
  • Author
  • Valued Contributor
  • 426 replies
  • July 21, 2016

@mm2270 thank you! we'll review the process in case if it is possible to change the scenarion and use cocoaDialog


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