mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-31 04:54:43 +00:00
Ollama: fix version extraction from GitHub API compact JSON response
This commit is contained in:
+5
-1
@@ -27,7 +27,11 @@ function update_script() {
|
|||||||
msg_error "No Ollama Installation Found!"
|
msg_error "No Ollama Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
|
RELEASE=$(curl -fsSL "https://api.github.com/repos/ollama/ollama/releases/latest" | sed -n 's/.*"tag_name" *: *"\([^"]*\)".*/\1/p' | head -1)
|
||||||
|
if [[ -z "${RELEASE}" || ! "${RELEASE}" =~ ^v[0-9] ]]; then
|
||||||
|
msg_error "Failed to determine latest Ollama version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [[ ! -f /opt/Ollama_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/Ollama_version.txt)" ]]; then
|
if [[ ! -f /opt/Ollama_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/Ollama_version.txt)" ]]; then
|
||||||
if [[ ! -f /opt/Ollama_version.txt ]]; then
|
if [[ ! -f /opt/Ollama_version.txt ]]; then
|
||||||
touch /opt/Ollama_version.txt
|
touch /opt/Ollama_version.txt
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ $STD apt install -y --no-install-recommends intel-basekit-2024.1
|
|||||||
msg_ok "Installed Intel® oneAPI Base Toolkit"
|
msg_ok "Installed Intel® oneAPI Base Toolkit"
|
||||||
|
|
||||||
msg_info "Installing Ollama (Patience)"
|
msg_info "Installing Ollama (Patience)"
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/ollama/ollama/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
|
RELEASE=$(curl -fsSL "https://api.github.com/repos/ollama/ollama/releases/latest" | sed -n 's/.*"tag_name" *: *"\([^"]*\)".*/\1/p' | head -1)
|
||||||
|
if [[ -z "${RELEASE}" || ! "${RELEASE}" =~ ^v[0-9] ]]; then
|
||||||
|
msg_error "Failed to determine latest Ollama version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
OLLAMA_INSTALL_DIR="/usr/local/lib/ollama"
|
OLLAMA_INSTALL_DIR="/usr/local/lib/ollama"
|
||||||
BINDIR="/usr/local/bin"
|
BINDIR="/usr/local/bin"
|
||||||
mkdir -p $OLLAMA_INSTALL_DIR
|
mkdir -p $OLLAMA_INSTALL_DIR
|
||||||
|
|||||||
Reference in New Issue
Block a user