<단순한 텍스트로 구성할 경우>

$> vi /etc/motd

 

<색상을 넣고 싶은 경우>

$> vi create_motd.sh

    #!/bin/bash

    #define the filename to use as output

    motd="./motd"

    # Collect useful information about your system

    # $USER is automatically defined

    HOSTNAME=`uname -n`

    KERNEL=`uname -r`

    CPU=`uname -p`

    ARCH=`uname -m`

     

    # The different colours as variables

    Black="\033[0;30m"

    Red="\033[0;31m"

    Green="\033[0;32m"

    Blue="\033[0;33m"

    Purple="\033[0;34m"

    Cyan="\033[0;35m"

    Silver="\033[0;36m"

    DarkGray="\033[1;30m"

    LightBlue="\033[1;34m"

    LightGreen="\033[1;32m"

    LightCyan="\033[1;36m"

    LightRed="\033[1;31m"

    Yellow="\033[1;33m"

    White="\033[1;37m"

    X="\033[0;0m"

     

    clear > $motd # to clear the screen when showing up

    echo -e "$Red#=============================================================================#" >> $motd

    echo -e "   $White Welcome $Blue $USER $White to $Blue $HOSTNAME                " >> $motd

    echo -e "   $Red ARCH   $White= $ARCH                                   " >> $motd

    echo -e "   $Red KERNEL $White= $KERNEL                                 " >> $motd

    echo -e "   $Red CPU    $White= $CPU                                    " >> $motd

    echo -e "$Red#=============================================================================#" >> $motd

    echo -e "$Yellow

    This is a server to treat the personal information.

    If you have access to this server with unjustified way, you can receive legal penalty.

    Only your activities are allowed within the authority granted to you, and you can receive legal penalty for breaching it.

    You here all the activities are being recorded.

    In case of any problems, please feel free to contact abc@abc.com.

    (Tel. 010-0000-0000)" >> $motd

    echo -e "$X" >> $motd

$> chmod +x ./create_motd.sh

$> ./create_motd.sh

$> cp ./motd /etc/motd

 

'TA > Common' 카테고리의 다른 글

umount: device is busy  (0) 2013.02.04
glusterfs 3.3 설치 및 구성  (0) 2013.02.04
설치된 OS 버전 확인  (0) 2013.02.04
disk 추가 후, partition, format  (0) 2013.02.04
yum  (0) 2013.02.04
Posted by 옥탑방람보
,