mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-13 02:39:43 +00:00
Refactor: Photoprism (#6335)
This commit is contained in:
parent
e54ed7dc35
commit
202eb3fb2a
2 changed files with 85 additions and 30 deletions
|
@ -27,22 +27,35 @@ function update_script() {
|
|||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Stopping PhotoPrism"
|
||||
sudo systemctl stop photoprism
|
||||
msg_ok "Stopped PhotoPrism"
|
||||
|
||||
msg_info "Updating PhotoPrism"
|
||||
$STD apt-get install -y libvips42
|
||||
curl -fsSL https://dl.photoprism.app/pkg/linux/amd64.tar.gz | tar -xzf - -C /opt/photoprism --strip-components=1
|
||||
msg_ok "Updated PhotoPrism"
|
||||
RELEASE=$(curl -fsSL https://api.github.com/repos/photoprism/photoprism/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
|
||||
if [[ "${RELEASE}" != "$(cat ~/.photoprism 2>/dev/null)" ]] || [[ ! -f ~/.photoprism ]]; then
|
||||
msg_info "Stopping PhotoPrism"
|
||||
systemctl stop photoprism
|
||||
msg_ok "Stopped PhotoPrism"
|
||||
|
||||
msg_info "Starting PhotoPrism"
|
||||
sudo systemctl start photoprism
|
||||
msg_ok "Started PhotoPrism"
|
||||
msg_ok "Update Successful"
|
||||
fetch_and_deploy_gh_release "photoprism" "photoprism/photoprism" "prebuild" "latest" "/opt/photoprism" "*linux-amd64.tar.gz"
|
||||
|
||||
LIBHEIF_URL=$(curl -fsSL "https://dl.photoprism.app/dist/libheif/" | grep -oP "libheif-$(lsb_release -cs)-amd64-v[0-9\.]+\.tar\.gz" | sort -V | tail -n 1)
|
||||
if [[ "${LIBHEIF_URL}" != "$(cat ~/.photoprism_libheif 2>/dev/null)" ]] || [[ ! -f ~/.photoprism_libheif ]]; then
|
||||
msg_info "Updating PhotoPrism LibHeif"
|
||||
$STD apt-get install -y libvips42
|
||||
curl -fsSL "https://dl.photoprism.app/dist/libheif/$LIBHEIF_URL" -o /tmp/libheif.tar.gz
|
||||
tar -xzf /tmp/libheif.tar.gz -C /usr/local
|
||||
ldconfig
|
||||
echo "${LIBHEIF_URL}" >~/.photoprism_libheif
|
||||
msg_ok "Updated PhotoPrism LibHeif"
|
||||
fi
|
||||
|
||||
msg_info "Starting PhotoPrism"
|
||||
systemctl start photoprism
|
||||
msg_ok "Started PhotoPrism"
|
||||
msg_ok "Update Successful"
|
||||
else
|
||||
msg_ok "No update required. ${APP} is already at v${RELEASE}"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue