Restore version check for updates on container restart

This commit is contained in:
thespad 2024-09-11 17:40:12 +01:00
parent 33bcc9ae92
commit 427d934015
No known key found for this signature in database

View File

@ -17,11 +17,18 @@ fi
export DEBIAN_FRONTEND="noninteractive"
if [[ ! -e /usr/bin/calibre-server ]]; then
CALIBRE_RELEASE="$(cat /CALIBRE_RELEASE)"
if [ -z ${CALIBRE_RELEASE+x} ]; then
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi
if [[ ! -e /usr/bin/calibre-server ]] || [[ "${CALIBRE_RELEASE}" != "$(cat /config/.CALIBRE_RELEASE || :)" ]]; then
tar xf \
/tmp/calibre.txz \
-C /app/calibre
rm /tmp/calibre.txz
echo "Installing Calibre version $(cat /CALIBRE_RELEASE)"
/app/calibre/calibre_postinstall
echo "${CALIBRE_RELEASE}" > /config/.CALIBRE_RELEASE
fi