[PATCH aiaiai 1/7] send-mail-on-failure: generalize email address

Jacob Keller jacob.e.keller at intel.com
Fri Apr 4 15:06:46 PDT 2014


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 at 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 at intel.com>
---
 email/systemd/send-mail-on-failure.sh       | 9 ++++++---
 email/systemd/send-mail-on-failure at .service | 3 ++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/email/systemd/send-mail-on-failure.sh b/email/systemd/send-mail-on-failure.sh
index c382e4ed93f6..e8fbb0dfaa80 100755
--- a/email/systemd/send-mail-on-failure.sh
+++ b/email/systemd/send-mail-on-failure.sh
@@ -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 at intel.com
+systemctl status -n 100 "$service"
+) | mutt -s "$service crashed!" $email
diff --git a/email/systemd/send-mail-on-failure at .service b/email/systemd/send-mail-on-failure at .service
index b0be9f0ab43a..8a707d136294 100644
--- a/email/systemd/send-mail-on-failure at .service
+++ b/email/systemd/send-mail-on-failure at .service
@@ -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 at localhost
-- 
1.8.3.1




More information about the aiaiai mailing list