Hey Folks,
Having some trouble. I have need to run a bash script (or command file) so that it opens and displays to the user and is interactive. The user gives input and sees information, so the jamf binary can't run it silently. However, the script they are interacting with uses some commands that require root access (jamf, for example). I want the script to open with root privileges. I figured having the Jamf binary launch the script would do this, effectively acting as a wrapper and granting root access since it is launching the script. I did this by packaging the script, placing it in a policy, and then attaching a post script to the policy to "open" the command file. The policy is then run in self service which silently installs the script file and then opens it. It seemed to be working for a bit, but I added a jamf command to it now and it says it must be run as root. I don't want to prompt the user for their password, I just want the whole script run as root. Is this possible?
As a fallback option, is there an elegant way of asking for an admin user's credentials at the beginning of the script (different than the GUI logged in user) and then using those creds later on as sudo is needed?
Any help would be greatly appreciated.