When Linux users find themselves looking for meaning of life on their consoles, they created motd for get inspired from other peoples of sayings ^^ [source: a mockingbird]
MOTD is an abbreviation of “message of the day”. The contents of /etc/motd
are displayed by login after a successful login but just before it executes the login shell.
It isn’t a big deal using or not. But, i wanted to create a bash script for create motd file dynamically. I spending so much time on the consoles of servers. Sometimes i need to see a good saying and some information about the server.
Here is the script:
The script is manipulating /etc/motd
file when you run it.
You can place this script under /usr/local/bin
directory and you can give +x
permission to it. Then you can add it into your crontab
.
*/5 * * * * /usr/local/bin/create-motd > /dev/null 2>&1
I used an API (zenquotes.io)
for meaningful good quotes. If you wanna you can remove quotes or add another variables into the bash script. Use it as you wish, all yours.
You can change the ASCII chars. I used this tool for create an ASCII banner: https://www.asciiart.eu/text-to-ascii-art