Files
awoooi/scripts/reboot-recovery/awoooi-telegram-notify.sh

35 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -Eeuo pipefail
PHASE=""
STATUS=""
ARTIFACT_DIR=""
MESSAGE=""
while [[ $# -gt 0 ]]; do
case "$1" in
--phase) PHASE="$2"; shift 2 ;;
--status) STATUS="$2"; shift 2 ;;
--artifact-dir) ARTIFACT_DIR="$2"; shift 2 ;;
--message) MESSAGE="$2"; shift 2 ;;
*) echo "Unknown argument: $1" >&2; exit 2 ;;
esac
done
TEXT="[AWOOOI reboot-recovery] phase=${PHASE} status=${STATUS}
${MESSAGE}
artifact=${ARTIFACT_DIR}"
# Reboot recovery is outside the canonical API receipt boundary. Do not read
# a host-local Telegram binding and do not fall back to a direct provider call.
# The orchestrator keeps its local evidence; a correlated gateway transport
# must be supplied before Telegram delivery can be re-enabled.
printf '%s\n' \
"telegram_route_status=blocked_no_egress" \
"telegram_provider_send_performed=false" \
"telegram_blocked_reason=canonical_telegram_gateway_transport_required" \
"telegram_message_class=reboot_recovery" \
"telegram_phase=${PHASE}" \
"telegram_status=${STATUS}" >&2
exit 75