Pertaining to my previous post regarding an XDMCP host and thin clients – I realized the need to be able to see who is logged in and maybe the rights and privileges they have.

So I wrote a little shell script that allows me to do just this.

Here is the source code:

——————————————————————————————–

#!/bin/bash -x
action=$(xmessage -buttons yes,no -default yes -center -print “Do you want to see who is logged in?”)
if [ $action = yes ]; then
echo `w -s` 1>output.txt
else exit
fi
action=$(xmessage -buttons more,close -default more -center -print -file output.txt)
if [ $action = more ]; then
echo `id &uname` 1>output.txt
action=$(xmessage -buttons close -default close -center -print -file output.txt)
fi

———————————————————————————————-

Copy everything between the lines and paste into a text file with the extention .sh

It might be best to make a unique folder for it – it creates a text file called “output.txt” when it runs.

Once you have created the shell file, open a terminal and in the directory that you created the shell file type: chmod +x $yourfile.sh

Obviously you must insert the filename of the file you created in $yourfile.sh

Do not worry about making output.txt, the program creates it automatically. After doing all this you can create a launcher on your desktop or create a launcher in a menu.

Enjoy, and if you improve on it, post it in a comment and I will gladly include it!

No related posts.