BannerScript

From Rivalug Wiki

Jump to: navigation, search

rewrite /etc/rc.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

# Write issue and motd 
if [ -f /etc/redhat-release ]; then
    R=$(cat /etc/redhat-release)
    arch=$(uname -m)
    a="a"
    case "_$arch" in
            _a*) a="an";;
            _i*) a="an";;
    esac
    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
    if [ "$NUMPROC" -gt "1" ]; then
        SMP="$NUMPROC-processor "
        if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
            a="an"
        else
            a="a"
        fi
   fi
fi
# This will overwrite /etc/issue at every boot.  So, make any changes you
# want to make to /etc/issue here or you will lose them when you reboot.
/bin/cat >/etc/issue <<ISSUE
***************************************************************************
                           NOTICE TO USERS


This computer system is the private property of its owner, whether
individual, corporate or government.  It is for authorized use only.
Users (authorized or unauthorized) have no explicit or implicit
expectation of privacy.
Any or all uses of this system and all files on this system may be
intercepted, monitored, recorded, copied, audited, inspected, and
disclosed to your employer, to authorized site, government, and law
enforcement personnel, as well as authorized officials of government
agencies, both domestic and foreign.
By using this system, the user consents to such interception, monitoring,
recording, copying, auditing, inspection, and disclosure at the
discretion of such personnel or officials.  Unauthorized or improper use
of this system may result in civil and criminal penalties and
administrative or disciplinary action, as appropriate. By continuing to
use this system you indicate your awareness of and consent to these terms
and conditions of use. LOG OFF IMMEDIATELY if you do not agree to the
conditions stated in this warning.
****************************************************************************
ISSUE
# This will overwrite /etc/motd at every boot.  So, make any changes you
# want to make to /etc/motd here or you will lose them when you reboot.
/bin/cp -f /etc/issue /etc/motd
/bin/ln -s /etc/issue /etc/issue.net
echo "$(hostname)" >> /etc/motd
echo "$R" >> /etc/motd
echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/motd
echo " " >> /etc/motd
echo " " >> /etc/motd
touch /var/lock/subsys/local

This page was last modified 15:04, 31 Dec 2004. This page has been accessed 112 times.

Personal tools