Hi -- My enthusiasm for Linux and computational physics has
lead me to start a small lab in which all the clients have
nfs-mounted the same server drive. This gives the student users
access to their data and configuration files no matter which
client in the lab they log into. I have some cute routines for
propagating password changes from the host to all the clients -- and they also propagate an motd file. I would like to make use of this motd. Problem is, most users login through
gdm, so they
never see an
motd.
I have two questions
1)
Is there a facility for gdm comparable to motd?
(I see there is a "postlogin" feature)
http://www.gnome.org/projects/gdm/docs/gdmtalk.pdf
2)
How can I distinguish whether user has launched a bash
shell on the local machine or is using ssh?
Even if users log in through GDM, many of them will eventually launch a terminal. I could edit the default .bashrc as follows:
Code:
if test -f /etc/motd
then
cat /etc/motd
fi
The problem is that if users login remotely via (
ssh), they'll see the motd twice. This is not elegant. So I need to check whether they are using ssh or launching a local xterm. There are some posts about
shopt, but I discovered that it did not do a good job
telling me whether a shell was remote or on the local machine.
I welcome suggestions.