Skip to content

Instantly share code, notes, and snippets.

@ashsearle
ashsearle / motd
Last active November 11, 2020 18:48
Shell script to display a random message once per day
#!/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