3 # Email logs of failed e2scrub unit runs when the systemd service fails.
6 test -z "${recipient}" && exit 0
8 test -z "${device}" && exit 0
9 hostname="$(hostname -f 2>/dev/null)"
10 test -z "${hostname}" && hostname="${HOSTNAME}"
11 if ! type sendmail > /dev/null 2>&1; then
12 echo "$0: sendmail program not found."
18 From: <e2scrub@${hostname}>
19 Subject: e2scrub failure on ${device}
21 So sorry, the automatic e2scrub of ${device} on ${hostname} failed.
23 A log of what happened follows:
25 systemctl status --full --lines 4294967295 "e2scrub@${device}") | sendmail -t -i