Skip to content

Instantly share code, notes, and snippets.

@ashsearle
ashsearle / motd
Last active Nov 11, 2020
Shell script to display a random message once per day
View motd
#!/bin/bash
CONFIG_DIR=~/.config/motd
MESSAGES="${CONFIG_DIR}/messages"
MESSAGES_LAST_DISPLAY="${MESSAGES}-last-display"
if [ ! -f "$MESSAGES" ]; then
echo "$0: Store messages in '${MESSAGES}' (file does not exist)"
exit 1
fi
You can’t perform that action at this time.