Restructure directory layout
To make this better than the unorganized mess it used to be.
This commit is contained in:
parent
58a36ed632
commit
c4f7279f2e
25 changed files with 0 additions and 727 deletions
30
sysadmin/unit_mail.sh
Executable file
30
sysadmin/unit_mail.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
MAILTO="root"
|
||||
MAILFROM="root@internal.heavensinferno.net"
|
||||
UNIT=$1
|
||||
|
||||
EXTRA=""
|
||||
for e in "${@:2}"; do
|
||||
EXTRA+="$e"$'\n'
|
||||
done
|
||||
|
||||
UNITSTATUS=$(systemctl status $UNIT)
|
||||
|
||||
sendmail $MAILTO <<EOF
|
||||
From:$MAILFROM
|
||||
To: $MAILTO
|
||||
Subject:[systemd timer] Status mail for unit: $UNIT
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
X-Priority: 1 (High)
|
||||
X-MSMail-Priority: High
|
||||
Importance: High
|
||||
|
||||
Status report for unit: $UNIT
|
||||
$EXTRA
|
||||
|
||||
$UNITSTATUS
|
||||
EOF
|
||||
|
||||
echo -e "Status mail sent to: $MAILTO for unit: $UNIT"
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue