Posted on 02-07-2019 08:49 AM
Thank you in advance for any assistance.
need: I need to make a simple UI with input and response ability so employees are not required to open terminal. Users currently need to enter a challenge token using the CLI in terminal. Am I on the right path? Is this the cleanest way to do this?
sudo is not a requirement for the command to run
Posted on 02-07-2019 10:38 AM
Smarter people than me may have different insight on this.
I would say you are on the right track one call out thought is that I don't believe the JAMF Helper can ask for user input.
The way you might want to approach it to get around that challenge would be to called up AppleScript in a shell script.
a quick example of this would be:
#!/bin/sh
##Get Current User
currentUser=$( /usr/bin/stat -f %Su /dev/console )
echo "Current user is $currentUser"
/usr/bin/osascript <<EOT
set theResponse to display dialog "What's your code?" default answer "" with icon stop buttons {"Cancel", "Continue"} default button "Continue" with hidden answer
display dialog "My Secret Code is " & (text returned of theResponse) & "."
EOT
Posted on 02-08-2019 11:18 AM
Thank you Shawn. Much appreciated. I can work from this. I'm a newb at osascript but it is a good change to learn some new tricks. :)