From 6fd77dcd9f0bfc1568dce371748b97c4393f22c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Sun, 30 Mar 2025 17:16:55 +0200 Subject: [PATCH] Fix Ollama update logic (#3506) --- ct/openwebui.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ct/openwebui.sh b/ct/openwebui.sh index fa5172731..734fcaffb 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -28,11 +28,11 @@ function update_script() { exit fi - OLLAMA_VERSION=$(ollama -v | awk '{print $NF}') - if [ -n "$OLLAMA_VERSION" ]; then - RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [ -x "/usr/bin/ollama" ]; then + msg_info "Updating Ollama" + OLLAMA_VERSION=$(ollama -v | awk '{print $NF}') + RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then - msg_info "Updating Ollama" curl -fsSLO https://ollama.com/download/ollama-linux-amd64.tgz tar -C /usr -xzf ollama-linux-amd64.tgz rm -rf ollama-linux-amd64.tgz