Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script for setting a nice raspberry pi logo as MOTD on debian.
#!/bin/bash
logo="$(tput setaf 2)
.~~. .~~.
'. \ ' ' / .'$(tput setaf 1)
.~ .~~~..~. $(tput sgr0) _ _ $(tput setaf 1)
: .~.'~'.~. : $(tput sgr0) ___ ___ ___ ___| |_ ___ ___ ___ _ _ ___|_|$(tput setaf 1)
~ ( ) ( ) ~ $(tput sgr0) | _| .'|_ -| . | . | -_| _| _| | | | . | |$(tput setaf 1)
( : '~'.~.'~' : ) $(tput sgr0) |_| |__,|___| _|___|___|_| |_| |_ | | _|_|$(tput setaf 1)
~ .~ ( ) ~. ~ $(tput sgr0) |_| |___| |_| $(tput setaf 1)
( : '~' : )
'~ .~~~. ~'
'~'
$(tput sgr0)"
if [ `whoami` != "root" ]; then
echo "$logo"
echo "Run as root to update your motd."
else
echo "$logo" > /etc/motd.tail
/etc/init.d/bootlogs
echo "Updated MOTD. Log in to see the new logo."
fi
@Jamesking56

This comment has been minimized.

Copy link

commented Dec 19, 2013

This isn't working for me in raspbian.

@xvilo

This comment has been minimized.

Copy link

commented Dec 31, 2014

For people who want this to work on raspbian, change echo "$logo" > /etc/motd.tail (line 20) to echo "$logo" > /etc/motd

@chadyred

This comment has been minimized.

Copy link

commented Jul 20, 2016

Thank you xvillo !

@plasticruler

This comment has been minimized.

Copy link

commented Dec 27, 2016

There is a utility called toilet available via apt which lets you create coloured banners. The trick is to get toilet to export its output to ansi (much like how in this example the output of tput is). toilet -f big "text in font" --filter gay --export ansi > motdfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.