pmo: 07:02 heartbeat — q14 report imminent, q15 mid-B4, q16 gated, no flakes

This commit is contained in:
2026-08-29 07:04:03 -05:00
parent d4ed0b6132
commit 54751ae623
8 changed files with 181 additions and 13 deletions
+16 -12
View File
@@ -17,21 +17,25 @@ SEV="${2:-info}"
STAMP="$(date '+%m-%d %H:%M')"
LINE="[$SEV $STAMP MOPAC] $MSG"
if [ ! -f "$CONF" ]; then
mkdir -p "$(dirname "$QUEUE")"
echo "$LINE" >> "$QUEUE"
echo "ping queued (no relay config): $LINE" >&2
exit 0
fi
set -a; . "$CONF"; set +a
# Relay cascade (Charles 2026-08-29: local postfix relay presumed; failing
# that, authenticated Cloudron submission if configured; else queue).
FROM_ADDR="mopac@ultix-streaming.local"
if [ -f "$CONF" ]; then set -a; . "$CONF"; set +a; fi
send_one() {
printf 'From: %s\nTo: %s\nSubject: MOPAC %s\nContent-Type: text/plain; charset=UTF-8\n\n%s\n' \
"$PING_FROM" "$DEST" "$SEV" "$1" \
| curl -sS --max-time 30 --ssl-reqd --url "smtp://$PING_SMTP_HOST" \
--mail-from "$PING_FROM" --mail-rcpt "$DEST" \
-u "$PING_SMTP_USER:$PING_SMTP_PASS" \
-T - && return 0 || return 1
"$FROM_ADDR" "$DEST" "$SEV" "$1" \
| curl -sS --max-time 15 --url "smtp://localhost:25" \
--mail-from "$FROM_ADDR" --mail-rcpt "$DEST" -T - 2>/dev/null && return 0
if [ -n "${PING_SMTP_HOST:-}" ] && [ "${PING_SMTP_USER:-}" != "fill-me@knownelement.com" ]; then
printf 'From: %s\nTo: %s\nSubject: MOPAC %s\nContent-Type: text/plain; charset=UTF-8\n\n%s\n' \
"$PING_FROM" "$DEST" "$SEV" "$1" \
| curl -sS --max-time 30 --ssl-reqd --url "smtp://$PING_SMTP_HOST" \
--mail-from "$PING_FROM" --mail-rcpt "$DEST" \
-u "$PING_SMTP_USER:$PING_SMTP_PASS" \
-T - 2>/dev/null && return 0
fi
return 1
}
if [ -f "$QUEUE" ] && [ -s "$QUEUE" ]; then