Dynamic Ubuntu-like message of the day for CentOS

angela 3096d6e69e updated screenshot 10 months ago
img 3096d6e69e updated screenshot 10 months ago
LICENSE c9fb0c679f Initial commit 1 year ago
README.md 14b9f1375a add epel repo info 10 months ago
motd.sh 727c436512 legacy code update 10 months ago
update-check.sh 650af47fef formatting cleanup 10 months ago

README.md

Ubuntu-like Message of the Day for CentOS

Automate checking for updates and have them emailed, with a useless stylized & colored figlet screen - just because.

Will also work on other Redhat-based systems like Fedora and derivatives.

centos motd screenshot

Dependencies

  • figlet
  • lolcat
  • EPEL Repository

If you do not have EPEL repo enabled (or are unsure if you do), first run (as root/sudo):

yum install epel-release

Then, install dependencies:

yum install figlet
yum install rubygems
gem install lolcat

Mimic the Ubuntu setup

mkdir /etc/update-motd.d/

Place the following scripts in your preferred directory (and take note of their path), ex: /home/user/motd/

Make the scripts executable

chmod +x update-check.sh && chmod +x motd.sh

Edit the profile to assign a motd

nano /etc/profile

Add to the bottom of /etc/profile:

/home/motd.sh

Add a cron as root, which will trigger a check for updates and cache the number of updates available

crontab -e

Set your desired time for the update script to run

28 2 * * * /home/user/update-check.sh

Done.