[Casper] Script to open an app after install
Miles Leacy
miles.leacy at themacadmin.com
Tue Feb 3 12:49:17 PST 2009
I haven't tested this, it's just an idea off the top of my head...
Given:
Policies run as root.
An "open" command run as root won't open the item in another user's session
(I believe).
Try:
#!/bin/bash
if [ `who | grep -c "$3"` -gt 0 ] ; then
su $3
open /Applications/Utilities/MyApp.app
else echo "No user is logged in"
fi
Assuming I have my syntax right (and I'm not at a point in my day where I
can test this), this will test to see if $3 is logged in ($3 being the
username of the logged-in user as passed by Casper). If $3 is logged in,
the script will switch users to $3 from root, then run the open command.
----------
Miles A. Leacy IV
Certified System Administrator 10.4
Certified Technical Coordinator 10.5
Certified Trainer
Certified Casper Administrator
----------
voice: 1-347-277-7321
miles.leacy at themacadmin.com
www.themacadmin.com
2009/2/3 Dagel, Rich <Rich.Dagel at landor.com>
> I am trying to write a script that will open an app once it is installed
> by a policy. I have to script set to run after but no luck.
>
> #!/bin/sh
>
> open /Applications/Utilities/MyApp.app
>
>
> Rich Dagel
> Senior Technology Specialist
>
> Landor Associates
> 1001 Front Street
> San Francisco, CA 94111
> United States
> 415 365 3933
> *http://www.landor.com
> **Rich.Dagel at landor.com*
>
> _______________________________________________
> Casper mailing list
> Casper at list.jamfsoftware.com
> http://list.jamfsoftware.com/mailman/listinfo/casper
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.jamfsoftware.com/pipermail/casper/attachments/20090203/c3e2720e/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 580 bytes
Desc: not available
Url : http://list.jamfsoftware.com/pipermail/casper/attachments/20090203/c3e2720e/attachment.gif
More information about the Casper
mailing list