mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-12-16 20:23:32 +01:00
fix:ct/openwebui.sh adding progressbar and minimize service downtime (#9894)
This commit is contained in:
@ -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"
|
||||
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"
|
||||
curl -fsSLO -C - https://ollama.com/download/ollama-linux-amd64.tgz
|
||||
|
||||
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_info "Starting Service"
|
||||
msg_ok "Installed Ollama"
|
||||
|
||||
msg_info "Starting Ollama Service"
|
||||
systemctl start ollama
|
||||
msg_info "Started Service"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user