32 lines
832 B
Bash
Executable File
32 lines
832 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Called by the NEW session after /reset to notify Germaine and Anita
|
|
set -euo pipefail
|
|
|
|
FLAG_FILE="/root/.hermes/.just_reset"
|
|
|
|
if [ ! -f "$FLAG_FILE" ]; then
|
|
# No reset happened, nothing to do
|
|
exit 0
|
|
fi
|
|
|
|
# Read the timestamp
|
|
RESET_TIME=$(cat "$FLAG_FILE" 2>/dev/null || echo "unknown")
|
|
|
|
# 1. Notify Anita she's back
|
|
python3 << 'PYEOF'
|
|
import requests
|
|
|
|
token = "8797435889:AAER9zMnRHtAkTfVcifLdoPMu1XDPr6XkBk"
|
|
chat_id = "8200236464"
|
|
msg = "✅ *Sho'Nuff is back online.*\n\nReady to go."
|
|
|
|
url = f"https://api.telegram.org/bot{token}/sendMessage"
|
|
data = {"chat_id": chat_id, "text": msg, "parse_mode": "Markdown"}
|
|
r = requests.post(url, data=data, timeout=10)
|
|
print(f"ANITA_STATUS={r.status_code}")
|
|
PYEOF
|
|
|
|
# Remove the flag so it doesn't fire again
|
|
rm -f "$FLAG_FILE"
|
|
echo "BACK_ONLINE_NOTIFICATION_SENT"
|