From df41b8e7076126c1593f7fb8883dbce3580c7479 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 11:43:44 +0200 Subject: [PATCH] Open WebUI: Add Ollama update check (#3478) * Add Ollama update check * Update openwebui.sh * Fix Ollama update * fixes --- ct/openwebui.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 738a04386..fa5172731 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -27,6 +27,21 @@ function update_script() { msg_error "No ${APP} Installation Found!" 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 [ "$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 + msg_ok "Ollama updated to version $RELEASE" + else + msg_ok "Ollama is already up to date." + fi + fi + msg_info "Updating ${APP} (Patience)" cd /opt/open-webui mkdir -p /opt/open-webui-backup