mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 06:22:53 +00:00
refactor: move proxy to monorepo
This commit is contained in:
22
backend/proxy/systemd/stapps-unit-status-mail.sh
Normal file
22
backend/proxy/systemd/stapps-unit-status-mail.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
MAILTO=`cat ../config/RECIPIENTS`
|
||||
UNIT=$1
|
||||
|
||||
EXTRA=""
|
||||
for e in "${@:2}"; do
|
||||
EXTRA+="$e"$'\n'
|
||||
done
|
||||
|
||||
UNITSTATUS=$(systemctl status --lines=50 $UNIT)
|
||||
|
||||
ssmtp $MAILTO <<EndOfMessage
|
||||
To:$MAILTO
|
||||
Subject:Status mail for unit: $UNIT
|
||||
|
||||
Status report for unit: $UNIT
|
||||
$EXTRA
|
||||
|
||||
$UNITSTATUS
|
||||
EndOfMessage
|
||||
|
||||
echo -e "Status mail sent to: $MAILTO for unit: $UNIT"
|
||||
Reference in New Issue
Block a user