Logout of Aqua questions

pobs

Registered
Hello all,

I am trying to write a script that will allow me an easy way to logout other aqua 'users' on my 10.3.3 machine. I say 'users' because I treat users like different aspects of 'myself'

i.e. - one for work, one for each of my courses, one for teaching, one for research, etc.

Often when I am working throughout the day I will login to a variety of these different users and use fast-user switching to do work with other users. Sometimes I want to log another user out using a shell script so I wrote this....


#!/bin/sh
killfunc(){

echo "***************BEFORE**************"
ps uxc -U $logoutGuy

su $logoutGuy -c "kill -15 -1"

sleep 3

echo "\\\\\\\\\\\\AFTER\\\\\\\\\\\\\\"
ps uxc -U $logoutGuy

}

echo "Who would you like to logout?"

read logoutGuy

killfunc


.... my first question is...

Is using a shell script to do this a bad thing to do?

... my second question is...

Is there a way to query the loginwindow for users who are logged into the aqua interface so I can list them at the beginning of this script?

... my third question is...

Does anyone have another method for doing this?
//I was thinking that it might be nice to somehow integrate a 'logout' button into the F.U.S. drop-down so that one can terminate all the applications of a user without having to switch-in (switching in requires pswd typing and takes too much time )

Thanks in advance.

Pobs
 
I would suggest you have a look at AppleScript because you may be able to do a lot of that with an interface, if you so desired.

I don't believe there's a simple way of hacking the FUS SystemUIServer element since it's compiled and not open source (as far as I know) so idea 3 looks like a dead end for the moment.

I'm on my iBook and it only has one user, I don't think it would like FUS much, but you can have a look at `who` instead of `ps` to see if it will read something like

[work@Homsar ~]% who
work console May 17 18:21
teaching console May 17 18:22
work ttyp1 May 17 18:35
 
Back
Top