fix:ct/openwebui.sh adding progressbar and minimize service downtime (#9894)

This commit is contained in:
jobben-2025
2025-12-15 22:17:00 +01:00
committed by GitHub
parent d0a09ccd5d
commit c269dc3b13

View File

@ -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