From d1f7ea1d254a4edcca52587b8745d3f3fd439218 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 18 Jul 2018 10:56:46 +0200 Subject: bin/systemd-email new --- bin/systemd-email | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/systemd-email diff --git a/bin/systemd-email b/bin/systemd-email new file mode 100755 index 0000000..7cc4a3b --- /dev/null +++ b/bin/systemd-email @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + >&2 echo 'systemd-email unit-name.service' + >&2 echo ' send an email about a systemd unit' + exit 2 +fi + +{ + printf 'To: archlinux32-logs@eckner.net\n' + printf 'From: systemd <%s@%s>\n' \ + "$(whoami)" \ + "$(hostname)" + printf 'Subject: %s\n' \ + "$1" + printf 'Content-Transfer-Encoding: 8bit\n' + printf 'Content-Type: text/plain; charset=UTF-8\n' + printf '\n' + systemctl --user status --full "$1" +} | \ + /usr/bin/digest-mailer -- cgit v1.2.3