Fix Ollama update logic (#3506)
Some checks failed
Create Changelog Pull Request / update-changelog-pull-request (push) Has been cancelled
Auto Update .app-files / update-app-files (push) Has been cancelled
Crawl Versions from newreleases.io / crawl-versions (push) Has been cancelled
Build and Publish Docker Image / build (push) Has been cancelled
Create Daily Release / create-daily-release (push) Has been cancelled

This commit is contained in:
Slaviša Arežina 2025-03-30 17:16:55 +02:00 committed by GitHub
parent 92c6662abf
commit 6fd77dcd9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,11 +28,11 @@ function update_script() {
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 [ -x "/usr/bin/ollama" ]; then
msg_info "Updating Ollama"
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 "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