20 lines
548 B
Bash
20 lines
548 B
Bash
|
|
#!/bin/bash
|
||
|
|
# Runs the daily email digest (Issue #124).
|
||
|
|
# Install as host cron:
|
||
|
|
# crontab -e
|
||
|
|
# 0 7 * * * /opt/gwoe-antragspruefer/scripts/run-digest.sh >> /var/log/gwoe-digest.log 2>&1
|
||
|
|
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
CONTAINER=gwoe-antragspruefer
|
||
|
|
|
||
|
|
# Nur ausführen wenn Container läuft
|
||
|
|
if ! docker ps --format '{{.Names}}' | grep -q "^${CONTAINER}$"; then
|
||
|
|
echo "$(date -Iseconds) SKIP — ${CONTAINER} is not running"
|
||
|
|
exit 0
|
||
|
|
fi
|
||
|
|
|
||
|
|
echo "$(date -Iseconds) START daily digest"
|
||
|
|
docker exec "$CONTAINER" python -m app.mail
|
||
|
|
echo "$(date -Iseconds) END"
|