Difference between revisions of "Motd"

From ArchWiki
Jump to: navigation, search
m
(wrong information, see man motd)
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.
Line 6: Line 5:
 
or anything you wish to tell.
 
or anything you wish to tell.
  
Here is my script to create a MotD with some useful Information.
+
[[Category:Boot process (English)]]
#!/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)
 

Revision as of 00:23, 3 September 2011

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.