#!/usr/bin/env bash # openclaw-watchdog installer (Krilly's fork — Telegram + Gotify edition) # https://github.com/jlgrimes/openclaw-watchdog set -euo pipefail INSTALL_DIR="$HOME/.openclaw" SERVICE_NAME="openclaw-watchdog" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo "🦞 OpenClaw Watchdog — Installer (Krilly's Telegram/Gotify Edition)" echo "───────────────────────────────────────────────────────────────────" # Ensure install dir exists mkdir -p "$INSTALL_DIR" # Copy watchdog script cp "$SCRIPT_DIR/watchdog.sh" "$INSTALL_DIR/watchdog.sh" chmod +x "$INSTALL_DIR/watchdog.sh" echo "✅ Installed watchdog.sh → $INSTALL_DIR/watchdog.sh" # Prompt for Telegram bot token TELEGRAM_BOT_TOKEN="" read -rp "Telegram Bot Token (leave blank to skip): " TELEGRAM_BOT_TOKEN # Prompt for Gotify token GOTIFY_TOKEN="" read -rp "Gotify Token (leave blank to skip): " GOTIFY_TOKEN # Prompt for custom Gotify URL GOTIFY_URL="http://runtipi.kangaroo-eel.ts.net:8129" read -rp "Gotify URL [$GOTIFY_URL]: " custom_gotify [[ -n "$custom_gotify" ]] && GOTIFY_URL="$custom_gotify" # Create env file ENV_FILE="$INSTALL_DIR/watchdog.env" cat > "$ENV_FILE" </dev/null <