mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
bin: Improve readability of email body
This commit is contained in:
parent
ab408ce653
commit
e4fec3883b
1 changed files with 8 additions and 1 deletions
|
@ -47,7 +47,14 @@ while true; do
|
||||||
TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND))
|
TIME_SINCE_LAST_SEND=$(($TIME_NOW - $LAST_EMAIL_SEND))
|
||||||
|
|
||||||
if [ "$TIME_SINCE_LAST_SEND" -gt "$TIME_BETWEEN_EMAILS" ]; then
|
if [ "$TIME_SINCE_LAST_SEND" -gt "$TIME_BETWEEN_EMAILS" ]; then
|
||||||
printf "Server was restarted at: $(date)\nThe last 50 lines of the log before the error happens:\n $(tail -n 50 "${LOG}")" | mail -s "Pad Server was restarted" "$EMAIL_ADDRESS"
|
{
|
||||||
|
cat <<EOF
|
||||||
|
Server was restarted at: $(date)
|
||||||
|
The last 50 lines of the log before the error happens:
|
||||||
|
|
||||||
|
EOF
|
||||||
|
tail -n 50 "${LOG}"
|
||||||
|
} | mail -s "Pad Server was restarted" "$EMAIL_ADDRESS"
|
||||||
|
|
||||||
LAST_EMAIL_SEND=$TIME_NOW
|
LAST_EMAIL_SEND=$TIME_NOW
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue