jamf displayMessage proof of concept help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 11-05-2009 08:44 AM
So, I am trying to run some automation with a bit of end user interaction. If I use the jamf displayMessage binary to display a message it will return the output back into terminal, but I can't seem to quite make the connection.
Basically I want to run the command along with other commands and then the user clicks on the OK button it will trigger the last or final command of the policy.
Here is what I got, proof of concept wise, but it is very very broken. Anyone else got any ideas?
#!/bin/bash
#test jamf display message command
selection=
/usr/sbin/jamf displayMessage -message "testing"
until [ "$selection" = "button returned: OK" ] ; do
case $selection in
"button returned:OK" ) /bin/echo "the test is over" ;; esac done
Thomas Larkin
TIS Department
KCKPS USD500
tlarki at kckps.org
blackberry: 913-449-7589
office: 913-627-0351
chown -R us /.base

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 11-06-2009 09:44 AM
I like to use Applescript to display windows because it is so easy. You can
even call it from a shell script like so:
#!/bin/sh
#script your commands here
touch file1
#this is the window block
/usr/bin/osascript << EOF
tell application "Finder"
activate
display dialog "Running Maintenance Tasks" buttons {"Finish IT!"} with icon
caution
end tell
EOF
#final command runs after button is pressed
touch file2
exit
Here is the pastebin link if the email gets munged.
http://pastebin.com/m454c9c14
Ryan M. Manly
Mac OS X Expert
Glenbrook High Schools
1835 Landwehr Rd.
Glenview, IL 60026
(847) 486-4948

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 11-09-2009 07:53 AM
What did you end up doing? I like looking at other's scripts. Gives me fun
ideas. :D
Ryan M. Manly
Mac OS X Expert
Glenbrook High Schools
1835 Landwehr Rd.
Glenview, IL 60026
(847) 486-4948
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 11-09-2009 08:00 AM
I sent him some information on using iHook to do the notification. The only
thing that iHook does that I don't like is that it puts an input box on the
page with an OK button. You don't have to put anything in the box, but it
is there. Not sure how to get that off in iHook.
The advantage to using iHook is that if you are already using it for
login/logout hooks you don't have to add anything more, just drop a new
script.
Steve Wood
Director of IT
swood at integer.com
The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 11-09-2009 09:08 AM
If you look at the instructions for lexicon use in iHook, there are several
things you add or change. One of those is an Input Box: %INPUT
ENABLE/DISABLE/REMOVE [prompt Title]. You can then read the input. Here's
a little script example they give:
#! /bin/sh
# read user input
echo "%INPUT ENABLE Please enter some text:"
read input
echo "%INPUT DISABLE Processing input..."
do_input_processing ${input}
echo %INPUT REMOVE
Using that you could solicit input from the user and then move on. Also, if
you just wanted to wait for a user to click OK before moving on with your
script, you could use that input box as such. The proof of concept I sent
was to open up Calculator.app after the OK button was pressed. That script
looked like this:
#!/bin/sh
echo "%INPUT ENABLE Please Close All Applications and press OK"
read input
echo "%INPUT DISABLE Processing...."
echo %INPUT REMOVE
open /Applications/Calculator.app
Steve Wood
Director of IT
swood at integer.com
The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475
