30 min delay for mail.sh
This commit is contained in:
1 parent
eaab960133
commit
c89cfe66e9
4 files changed
+163
-18
No files matched your search
@@ -46,13 +46,22 @@ if [ -z "$TO" ] || [ -z "$SUBJECT" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
PODMANCMD="$SUDO $PODMAN"
|
||||
if [ ! -z "$REMOTE" ]; then
|
||||
PODMANCMD="ssh $MAILSERVER_IP $PODMANCMD"
|
||||
fi
|
||||
|
||||
# der Mail-Container sollte laufen, falls nicht, dann ist wahrscheinlich der Backup
|
||||
# noch nicht durch => 30 Minuten warten
|
||||
$PODMANCMD ps | grep $MAILCONTAINER >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
sleep 30m
|
||||
fi
|
||||
|
||||
# Mail body aus Datei oder STDIN holen
|
||||
CONTENT=$(cat ${1:--})
|
||||
|
||||
MAILCMD="$SUDO $PODMAN exec -i $MAILCONTAINER /usr/sbin/sendmail -i -t"
|
||||
if [ ! -z "$REMOTE" ]; then
|
||||
MAILCMD="ssh $MAILSERVER_IP $MAILCMD"
|
||||
fi
|
||||
MAILCMD="$PODMANCMD exec -i $MAILCONTAINER /usr/sbin/sendmail -i -t"
|
||||
# construct mail header + content and pipe to sendmail
|
||||
cat <<EOMB | $MAILCMD
|
||||
FROM: hb42@gmx.de
|
||||
|
||||
Reference in new issue
Block a user