19 lines
436 B
Bash
19 lines
436 B
Bash
#!/bin/bash
|
|
|
|
THIS_SCRIPT="tips"
|
|
MOTD_DISABLE=""
|
|
|
|
[[ -f /etc/default/armbian-motd ]] && . /etc/default/armbian-motd
|
|
|
|
for f in $MOTD_DISABLE; do
|
|
[[ $f == $THIS_SCRIPT ]] && exit 0
|
|
done
|
|
|
|
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
|