Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Sep 2011 20:41:43 +0000 (UTC)
From:      "Helmut Schneider" <jumper99@gmx.de>
To:        freebsd-questions@freebsd.org
Subject:   Execute at login
Message-ID:  <xn0hjkvuc1rcr4o000@news.gmane.org>

next in thread | raw e-mail | index | archive | help
Hi,

which options do I have to execute at login?

I would like to implement something like update-motd [1] without
actually modifying /etc/motd. The code snippet is

if [ -d /etc/motd.d ]; then
  for FILE in /etc/motd.d/*; do
    [ -x ${FILE} ] && ${FILE}
  done
fi

It should be executed for all users but only at login (regardless if
she/he logs in via console or ssh). It also should be independent of
the login shell. Therefore neither /etc/profile nor ~/.profile nor
~/.login seem suitable.

Where can I put that code? The content of /etc/motd.d/ can change
anytime.

Thanks, Helmut

[1] https://wiki.ubuntu.com/UpdateMotd




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xn0hjkvuc1rcr4o000>