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 fi
if [ -x "/usr/bin/ollama" ]; then if [ -x "/usr/bin/ollama" ]; then
msg_info "Updating Ollama" msg_info "Checking for Ollama Update"
OLLAMA_VERSION=$(ollama -v | awk '{print $NF}') 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)}') 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 if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then
msg_info "Stopping Service" msg_info "Ollama update available: v$OLLAMA_VERSION -> v$RELEASE"
systemctl stop ollama msg_info "Downloading Ollama v$RELEASE \n"
msg_ok "Stopped Service" curl -fS#LO https://ollama.com/download/ollama-linux-amd64.tgz
curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz msg_ok "Download Complete"
rm -rf /usr/lib/ollama
rm -rf /usr/bin/ollama if [ -f "ollama-linux-amd64.tgz" ]; then
tar -C /usr -xzf ollama-linux-amd64.tgz
rm -rf ollama-linux-amd64.tgz msg_info "Stopping Ollama Service"
msg_info "Starting Service" systemctl stop ollama
systemctl start ollama msg_ok "Stopped Service"
msg_info "Started Service"
msg_ok "Ollama updated to version $RELEASE" 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 else
msg_ok "Ollama is already up to date." msg_ok "Ollama is already up to date."
fi fi