Rather than using a personal email address (oops!) generalize the
address in the script as an argument. In addition, modify the systemd
script to use root@localhost. The user *is* expected to modify the
systemd script in their own copy to point to the correct address.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
# Author: Jacob Keller
# License: GPLv2
+service=$1
+email=$2
+
(
-echo "$1 has crashed, and you need to restart it!"
+echo "$service has crashed, and you need to restart it!"
echo "Here is the systemctl status output:"
-systemctl status -n 100 "$1"
-) | mutt -s "$1 crashed!" jacob.e.keller@intel.com
+systemctl status -n 100 "$service"
+) | mutt -s "$service crashed!" $email
[Service]
User=aiaiai
-ExecStart=/home/aiaiai/git/aiaiai/systemd/send-mail-on-failure.sh %i
+# You should customize the email address here
+ExecStart=/home/aiaiai/git/aiaiai/systemd/send-mail-on-failure.sh %i root@localhost