From 9cb9014ed85a976a72126671ff0488da34745695 Mon Sep 17 00:00:00 2001 From: schmeeve Date: Fri, 22 May 2026 17:04:32 -0700 Subject: [PATCH] update ollama --- update-ollama | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 update-ollama diff --git a/update-ollama b/update-ollama new file mode 100755 index 0000000..926d838 --- /dev/null +++ b/update-ollama @@ -0,0 +1,43 @@ +#!/bin/bash +set -euo pipefail + +HOST="root@ollama-serve.loc" +OVERRIDE_DIR="/etc/systemd/system/ollama.service.d" +OVERRIDE_FILE="${OVERRIDE_DIR}/override.conf" + +for arg in "$@"; do + case "$arg" in + --help|-h) + cat <<'EOF' +Usage: update-ollama [options] + +SSH to ollama-serve.loc, pull latest Ollama, and apply environment overrides +via a systemd drop-in so they survive upgrades. + +Options: + -h, --help Show this help message and exit +EOF + exit 0 + ;; + esac +done + +ssh "${HOST}" bash -s <<'ENDSSH' +set -euo pipefail + +echo "=== Updating Ollama ===" +curl -fsSL https://ollama.com/install.sh | sh + +echo "" +echo "=== Applying environment overrides (systemd drop-in) ===" +mkdir -p /etc/systemd/system/ollama.service.d +cat > /etc/systemd/system/ollama.service.d/override.conf <<'EOF' +[Service] +Environment="OLLAMA_CONTEXT_LENGTH=16384" +Environment="OLLAMA_HOST=0.0.0.0" +EOF + +systemctl daemon-reload +systemctl restart ollama +echo "Done." +ENDSSH