Self Service - open script in Terminal

mhasman
Valued Contributor

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 6

davidacland
Honored Contributor II

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.

Look
Valued Contributor III

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

stevevalle
Contributor III

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
Valued Contributor

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
Legendary Contributor III

@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
Valued Contributor

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