Files
rpi-zigbee-stack/scripts/kuma-online.sh
T
david 2cc6193a82 feat: power-loss boot resilience for Klubhaus DietPi
- restart: always for stack services
- harden-boot.sh: fsck.repair, panic reboot, hardware watchdog,
  docker+zerotier enabled, klubhaus-stack.service autostart
- kuma-online.sh: push up-heartbeat to Kuma on boot
- RESILIENCE.md documents the Aug 30 failure + apply steps
2026-09-04 14:01:44 -07:00

19 lines
602 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Push an "up" heartbeat to every configured Kuma push URL.
# URLs live in /root/.kuma-push.env (one per line, # for comments).
ENV_FILE=/root/.kuma-push.env
[ -f "$ENV_FILE" ] || { echo "no $ENV_FILE"; exit 0; }
while IFS= read -r url; do
case "$url" in
""|"#"*) continue ;;
esac
if curl -fsS -G --data-urlencode "status=up" --data-urlencode "msg=pi-online" "$url" >/dev/null 2>&1; then
echo "OK ${url#https://up.notsosm.art/api/push/}"
else
echo "FAIL ${url#https://up.notsosm.art/api/push/}"
fi
done < "$ENV_FILE"