armbian-build/scripts/update-motd.d/35-motd

10 lines
264 B
Bash

#!/bin/bash
quotes="/etc/update-motd.d/quotes.txt"
if [[ -f $quotes ]]; then
random_line=$(shuf -i 1-$(wc -l < $quotes) -n 1)
quote=$(sed -n -e "$random_line"p $quotes)
[[ -n $quote ]] && echo -e "\e[93mTip of the day:\e[39m $quote\n"
fi