diff --git a/ct/openwebui.sh b/ct/openwebui.sh index 3b2ca3a30..b9e8caff2 100644 --- a/ct/openwebui.sh +++ b/ct/openwebui.sh @@ -88,22 +88,36 @@ EOF fi if [ -x "/usr/bin/ollama" ]; then - msg_info "Updating Ollama" + msg_info "Checking for Ollama Update" 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 "Stopping Service" - systemctl stop ollama - msg_ok "Stopped Service" - curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz - rm -rf /usr/lib/ollama - rm -rf /usr/bin/ollama - tar -C /usr -xzf ollama-linux-amd64.tgz - rm -rf ollama-linux-amd64.tgz - msg_info "Starting Service" - systemctl start ollama - msg_info "Started Service" - msg_ok "Ollama updated to version $RELEASE" + msg_info "Ollama update available: v$OLLAMA_VERSION -> v$RELEASE" + msg_info "Downloading Ollama v$RELEASE \n" + curl -fS#LO https://ollama.com/download/ollama-linux-amd64.tgz + msg_ok "Download Complete" + + if [ -f "ollama-linux-amd64.tgz" ]; then + + msg_info "Stopping Ollama Service" + systemctl stop ollama + msg_ok "Stopped Service" + + msg_info "Installing Ollama" + rm -rf /usr/lib/ollama + rm -rf /usr/bin/ollama + tar -C /usr -xzf ollama-linux-amd64.tgz + rm -rf ollama-linux-amd64.tgz + msg_ok "Installed Ollama" + + msg_info "Starting Ollama Service" + systemctl start ollama + msg_ok "Started Service" + + msg_ok "Ollama updated to version $RELEASE" + else + msg_error "Ollama download failed. Aborting update." + fi else msg_ok "Ollama is already up to date." fi