From 80976be664baeee778de9145c391bf1070b767c8 Mon Sep 17 00:00:00 2001 From: "Bastian (BaM)" Date: Sun, 14 Sep 2025 17:44:53 +0200 Subject: [PATCH] Remove auto-boot-ollama-host script as it is no longer needed for the current setup. --- scripts/auto-boot-ollama-host.sh | 52 -------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 scripts/auto-boot-ollama-host.sh diff --git a/scripts/auto-boot-ollama-host.sh b/scripts/auto-boot-ollama-host.sh deleted file mode 100644 index 52575cc..0000000 --- a/scripts/auto-boot-ollama-host.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -# Purpose: Watch docker logs of a host container and react to an error pattern. -# Notes: -# - This runs *inside* a container with /var/run/docker.sock mounted. -# - Requires docker CLI inside this container. - -# ---- Config via env (with sane defaults) ---- -CONTAINER_NAME="${CONTAINER_NAME:-paperless-ai}" -OLLAMA_HOST="${OLLAMA_HOST:-192.168.222.12}" -OLLAMA_PORT="${OLLAMA_PORT:-11434}" -ERROR_PATTERN="${ERROR_PATTERN:-Error: \\[ERROR\\] Document analysis failed: connect EHOSTUNREACH ${OLLAMA_HOST}:${OLLAMA_PORT}}" - -WOL_MAC="${WOL_MAC:-}" -WOL_BCAST="${WOL_BCAST:-192.168.222.255}" -WOL_PORT="${WOL_PORT:-9}" - -DOCKER_CLI="${DOCKER_CLI:-docker}" # docker CLI binary name -NC_CMD="${NC_CMD:-nc}" # netcat -WOL_MAC="${WOL_MAC:-}" # optional: MAC to WOL -SINCE="${SINCE:-0s}" # logs window (e.g., 5m) - -log() { printf '[%(%F %T)T] %s\n' -1 "$*"; } - -send_wol() { - # 'wol' can send to a specific broadcast IP and UDP port - wol -i "$WOL_BCAST" -p "$WOL_PORT" "$WOL_MAC" || true -} - -# Basic pre-flight: show which container is watched -log "Watching logs for container='${CONTAINER_NAME}' since='${SINCE}'" -log "Looking for pattern: ${ERROR_PATTERN}" - -# Stream logs and parse -"${DOCKER_CLI}" logs -f --since "${SINCE}" "${CONTAINER_NAME}" 2>&1 | \ -while IFS= read -r line; do - # echo "$line" # uncomment for debugging - if echo "$line" | grep -qE "${ERROR_PATTERN}"; then - log "Detected EHOSTUNREACH for Ollama (${OLLAMA_HOST}:${OLLAMA_PORT})." - - # ... in your remediation block: - if [[ -n "$WOL_MAC" ]]; then - log "Sending WOL to $WOL_MAC via ${WOL_BCAST}:${WOL_PORT}" - send_wol - fi - #until $NC_CMD -z "$OLLAMA_HOST" "$OLLAMA_PORT"; do - # log "Waiting for Ollama to be reachable..." - # sleep 2 - #done - #log "Ollama reachable again." - fi -done