Skip to content

MOTD: Debian based

Taylor Thurlow edited this page May 20, 2018 · 2 revisions

This information should apply to Debian, Ubuntu, and probably Raspbian.


Go to the /etc/update-motd.d folder and inspect its contents. The MOTD is formed by running each of these scripts in numerical order (really alphabetically, but the convention is to start each script with two numbers), as root. The factory MOTD is generated using these scripts.

If you desire to completely replace all of these scripts with panda-motd, it would be wise to make a copy of the update-motd.d folder, and then remove all of the factory scripts.

Create a new file in update-motd.d and call it 00-pandamotd, (or really, whatever you want). Remember, the numbers at the beginning of the filename are what determine the order of execution if you have any other scripts in the folder. In this file, use a text editor to write the contents as follows, substituting YOUR_USERNAME with your username:

#!/bin/sh

export LANG=en_US.UTF-8

echo "" > /var/log/panda-motd.error.log
panda-motd /home/YOUR_USERNAME/.config/panda-motd.yaml 2> /var/log/panda-motd.error.log
if [ -s "/var/log/panda-motd.error.log" ]
then
  echo "panda-motd had errors. Check '/var/log/panda-motd.error.log'."
fi

Make the new file you created executable, by doing:

sudo chmod +x /etc/update-motd.d/00-pandamotd

You should now be able to log in to the machine over SSH and see the generated MOTD. If there are any errors, you will be notified.

Clone this wiki locally