mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 10:22:50 +00:00 
			
		
		
		
	Ollama: Clean up old Ollama files before running update (#5534)
* Update ollama.sh * Update openwebui.sh
This commit is contained in:
		@@ -38,6 +38,8 @@ function update_script() {
 | 
				
			|||||||
    TMP_TAR=$(mktemp --suffix=.tgz)
 | 
					    TMP_TAR=$(mktemp --suffix=.tgz)
 | 
				
			||||||
    curl -fL# -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz"
 | 
					    curl -fL# -o "${TMP_TAR}" "https://github.com/ollama/ollama/releases/download/${RELEASE}/ollama-linux-amd64.tgz"
 | 
				
			||||||
    msg_info "Updating Ollama to ${RELEASE}"
 | 
					    msg_info "Updating Ollama to ${RELEASE}"
 | 
				
			||||||
 | 
					    rm -rf /usr/local/lib/ollama
 | 
				
			||||||
 | 
					    rm -rf /usr/local/bin/ollama
 | 
				
			||||||
    tar -xzf "${TMP_TAR}" -C /usr/local/lib/ollama
 | 
					    tar -xzf "${TMP_TAR}" -C /usr/local/lib/ollama
 | 
				
			||||||
    ln -sf /usr/local/lib/ollama/bin/ollama /usr/local/bin/ollama
 | 
					    ln -sf /usr/local/lib/ollama/bin/ollama /usr/local/bin/ollama
 | 
				
			||||||
    echo "${RELEASE}" >/opt/Ollama_version.txt
 | 
					    echo "${RELEASE}" >/opt/Ollama_version.txt
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,8 @@ function update_script() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if [ -x "/usr/bin/ollama" ]; then
 | 
					  if [ -x "/usr/bin/ollama" ]; then
 | 
				
			||||||
    msg_info "Updating Ollama"
 | 
					    msg_info "Updating Ollama"
 | 
				
			||||||
 | 
					    rm -rf /usr/lib/ollama
 | 
				
			||||||
 | 
					    rm -rf /usr/bin/ollama
 | 
				
			||||||
    OLLAMA_VERSION=$(ollama -v | awk '{print $NF}')
 | 
					    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)}')
 | 
					    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
 | 
					    if [ "$OLLAMA_VERSION" != "$RELEASE" ]; then
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user