Posted on 03-16-2011 12:30 AM
I've read conflicting reports on whether or not you can use the $3
variable with Casper Remote. I know it works on login/logout but does it
work if you run a script manually from Casper Remote? What does it do if
multiple users are logged in (fast user switching)?
It's not working in the test I'm doing, but then I dug this out of the archives...
The Casper Suite Documentation doesn't explicitly state this, but it
impliesthe values of these variables on page 170.$1 = Mount point of the
target drive. This is / if you're booted to thetarget or
/Volumes/targetDrive if you're not booted to it.$2 = the computer name$3
the current user's shortname. Note that this is not a loop, and $3doesn't
mean "do this to all users". If you use $3 in a script that is usedin a
login or logout policy, or a Casper Remote action that is run while
aclient is logged in, that $3 will equal the current user's username. If
noone is logged in, I believe $3 will be empty.----------Miles A. Leacy IV
Posted on 03-21-2011 08:44 AM
Chad,
I haven't tested to work out what happens with fast user switching and the $3 variable, but if you use the following command, it will always take the current active user logged in through the gui, even with another user logged in with fast user.
stat -f%Su /dev/console
I'd have thought Casper would do the same thing, but I've never tested it.
Sean
Posted on 03-21-2011 08:49 AM
I believe Casper only returns the current user at Login, via loginhook. So, using it once a user is logged it, it most likely will not detect the change. As Sean added, detecting ownership of /dev/console is a trick a lot of us like to use when detecting who is logged in.
-Tom