[Unit] Description=News Platform — Immediate Failure Alert for %i [Service] Type=oneshot EnvironmentFile=/etc/news-platform/healthcheck.env ExecStart=/bin/bash -c '\ NTFY_URL="${NTFY_URL:-}"; \ if [ -z "$NTFY_URL" ]; then \ echo "[alert] %i failed — no NTFY_URL configured, logging only"; \ exit 0; \ fi; \ AUTH=""; \ if [ -n "${NTFY_TOKEN:-}" ]; then AUTH="-H \"Authorization: Bearer $NTFY_TOKEN\""; fi; \ eval curl -fsS \ -H \"Title: %i crashed on $(hostname)\" \ -H \"Priority: urgent\" \ -H \"Tags: rotating_light\" \ $AUTH \ -d \"Service %i failed at $(date -u +%%Y-%%m-%%dT%%H:%%M:%%SZ). Check with: journalctl -u %i --since -5min\" \ \"$NTFY_URL\" || echo "[alert] Failed to send Ntfy notification"' StandardOutput=journal StandardError=journal SyslogIdentifier=news-alert