custom-motd
custom-motd copied to clipboard
Highly customizable Message of the Day script for Raspberry Pi
Custom MOTD
Highly customizable Message of the Day script for Raspberry Pi

Written in Bash. No other dependancies. So far tested with Raspbian Jessie only, but should work with most other Linux distributions.
The following steps may vary depending on the OS.
-
Download and save the
motd.shbash script onto your machine. Remember to add execute permissions and change the owner:$ wget https://raw.githubusercontent.com/SixBytesUnder/custom-motd/master/motd.sh $ sudo cp motd.sh /etc/profile.d/motd.sh $ sudo chown root:root /etc/profile.d/motd.sh $ sudo chmod +x /etc/profile.d/motd.shSimply execute the script to test if it works
./motd.shThat's it, from now on every time you ssh into your Raspberry, you should see the custom message of the day.
All below is optional
-
You can remove default MOTD, but it's not necessary since the script will clean the screen anyway.
$ sudo rm /etc/motd -
For the same reason as above, not necessary, but you may want to remove the "last login" message. Disable the
PrintLastLogoption from thesshdservice.$ sudo vim.tiny /etc/ssh/sshd_configYou should see:
PrintLastLog yesChange it to:
PrintLastLog noRestart the
sshdservice:$ sudo systemctl restart sshd
Options
At the top of the file are variables allowing customization of the messages:
-
settingsarray contains all possible messages to be displayed. Comment lines with a#for messages you don't want to see. Change order of items in array to change order of displayed messages. -
weatherCodeset region code for the weather message. Full list of available Accuweather location codes -
degreeschange value to "C" to show all temperatures in Celsius or "F" for Fahrenheit -
colourarray, lets you set your own colours. List of colour codes:Colour Value black 0 red 1 green 2 yellow 3 blue 4 magenta 5 cyan 6 white 7