#!/usr/bin/env bash
# setup-checks.sh — deploy check scripts to /opt/oikos/checks on each host.
# Auto-setup hook: tools/setup-*.sh runs after every git pull.
set -euo pipefail

CLONE_DIR="${HOMELAB_CONTEXT_DIR:-/opt/homelab}"
CHECK_SETUP="$CLONE_DIR/checks/install.sh"

if [ -f "$CHECK_SETUP" ]; then
  bash "$CHECK_SETUP" || echo "[setup-checks] WARNING: install.sh exited with code $?"
else
  echo "[setup-checks] no checks/install.sh found, skipping"
fi
