From ArchWiki
Revision as of 11:24, 14 December 2008 by Xauthority (talk | contribs)
Jump to: navigation, search

motd (Message of the day). This file is found in /etc that is displayed whenever some user log in, except they've specified a quiet login in their shell profile.

A good place to display your Terms of Service to remind users of your local policies or anything you wish to tell.

Here is my script to create a MotD with some useful Information.

#define the filename to use as output
# Collect useful information about your system
# $USER is automtically defined
HOSTNAME=`uname -n`
KERNEL=`uname -r`
CPU=`uname -p`
ARCH=`uname -m`
# The different colours as variables
clear > $motd # to clear the screen when showing up
echo -e "$R#=============================================================================#" >> $motd
echo -e "	$W Welcome $B $USER $W to $B $HOSTNAME                " >> $motd
echo -e "	$R ARCH   $W= $ARCH                                   " >> $motd
echo -e "	$R KERNEL $W= $KERNEL                                 " >> $motd
echo -e "	$R CPU    $W= $CPU                                    " >> $motd
echo -e "$R#=============================================================================#" >> $motd
echo -e "$X" >> $motd

Just copy the new created file called motd from the current directory to /etc (WARNING: if already a file called motd exists it will be overwritten)