Skip to content

Commit 6fd77dc

Browse files
authored
Fix Ollama update logic (#3506)
1 parent 92c6662 commit 6fd77dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ct/openwebui.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ function update_script() {
2828
exit
2929
fi
3030

31-
OLLAMA_VERSION=$(ollama -v | awk '{print $NF}')
32-
if [ -n "$OLLAMA_VERSION" ]; then
33-
RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
31+
if [ -x "/usr/bin/ollama" ]; then
32+
msg_info "Updating Ollama"
33+
OLLAMA_VERSION=$(ollama -v | awk '{print $NF}')
34+
RELEASE=$(curl -s https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
3435
if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then
35-
msg_info "Updating Ollama"
3636
curl -fsSLO https://ollama.com/download/ollama-linux-amd64.tgz
3737
tar -C /usr -xzf ollama-linux-amd64.tgz
3838
rm -rf ollama-linux-amd64.tgz

0 commit comments

Comments
 (0)