Jamf Self Service - Start new Terminal window and on it execute ruby script

Pleb
New Contributor

Hi,

I am struggling to do as the title says: Start new Terminal window and on it immediately execute ruby script "Ruby_install" that is kept locally in location "/Library/App_Installer"

I am trying to do this because the script has user interactions and shows progress/what happens to users, at some point it may ask for password from user (who is local admin).

Here is what I have tried so far:

  1. Add .command to my script and use "open install.command" to attempt to open Terminal. Instead it opens the script in Xcode and this is no-go since all users who will use this, will have Xcode on their workstations. Also this felt unreliable because "open install.command" does not specify that Terminal has to be used and may cause issues in certain scenarios.

  2. Tried writing new bash script which would open the mentioned ruby script:

    !/bin/bash

open -a Terminal.app /Library/App_Installer/RunInstall.sh

RunInstall.sh contains:
/usr/bin/ruby /Library/App_Installer/Ruby_install

Unfortunately that only crashed self service app itself and did not achieve what I wanted. Can someone point me to the right way?

1 REPLY 1

sharriston
Contributor III

What about using jamf helper to generate user input screens that you can pass as variables to your script? That what we use when we need user interaction for scripts.