Crear motd personalizado con figlet – Debian 6

18 01 2012

Podemos crear un motd personalizado para cada máquina con su nombre de host y que, además, se muestre en color. Para ello, modificaremos el fichero /etc/init.d/bootlogs dejando la parte superior tal que así:

do_start () {
# Update motd
uname -snrvm > /var/run/motd
echo `TERM=linux setterm -default -foreground green -bold on` > /etc/motd.tail
figlet `hostname -s` >> /etc/motd.tail
echo `TERM=linux setterm -default` >> /etc/motd.tail
[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
# Save kernel messages in /var/log/dmesg
if which dmesg >/dev/null 2>&1
then

Reiniciar el equipo y listo.

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: