Difference between revisions of "Motd"

From ArchWiki
Jump to: navigation, search
m (Motd moved to How to customize Motd: Clarify the contents)
m
Line 1: Line 1:
 +
[[Category:Boot process (English)]]
 
motd (Message of the day). This file is found in /etc that is displayed whenever
 
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.
 
some user log in, except they've specified a quiet login in their shell profile.

Revision as of 18:51, 18 October 2009

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.

#!/bin/bash
#define the filename to use as output
motd="motd"
# 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
W="\033[01;37m"
B="\033[01;34m"
R="\033[01;31m" 
X="\033[00;37m"
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)