]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
send-mail-on-failure: generalize email address
authorJacob Keller <jacob.e.keller@intel.com>
Fri, 4 Apr 2014 22:06:46 +0000 (15:06 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 7 Apr 2014 10:19:55 +0000 (13:19 +0300)
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>
email/systemd/send-mail-on-failure.sh
email/systemd/send-mail-on-failure@.service

index c382e4ed93f6069a8076a4f7aab9d03ca600ade8..e8fbb0dfaa8079c271f6f28eb44b318cad53e1db 100755 (executable)
@@ -4,8 +4,11 @@
 # 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
index b0be9f0ab43a944c33a8f93aaba1da25f9fa84ce..8a707d136294676189f4d41f469284cba39d5914 100644 (file)
@@ -6,4 +6,5 @@ Description=Send mail on failure of %i
 
 [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