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 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