Skip to content

Commit df41b8e

Browse files
authored
Open WebUI: Add Ollama update check (#3478)
* Add Ollama update check * Update openwebui.sh * Fix Ollama update * fixes
1 parent 3939b88 commit df41b8e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ct/openwebui.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30+
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) }')
34+
if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then
35+
msg_info "Updating Ollama"
36+
curl -fsSLO https://ollama.com/download/ollama-linux-amd64.tgz
37+
tar -C /usr -xzf ollama-linux-amd64.tgz
38+
rm -rf ollama-linux-amd64.tgz
39+
msg_ok "Ollama updated to version $RELEASE"
40+
else
41+
msg_ok "Ollama is already up to date."
42+
fi
43+
fi
44+
3045
msg_info "Updating ${APP} (Patience)"
3146
cd /opt/open-webui
3247
mkdir -p /opt/open-webui-backup

0 commit comments

Comments
 (0)