Skip to content

Commit 427d934

Browse files
committed
Restore version check for updates on container restart
1 parent 33bcc9a commit 427d934

File tree

1 file changed

+8
-1
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mod-universal-calibre-setup

1 file changed

+8
-1
lines changed

root/etc/s6-overlay/s6-rc.d/init-mod-universal-calibre-setup/run

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ fi
1717

1818
export DEBIAN_FRONTEND="noninteractive"
1919

20-
if [[ ! -e /usr/bin/calibre-server ]]; then
20+
CALIBRE_RELEASE="$(cat /CALIBRE_RELEASE)"
21+
if [ -z ${CALIBRE_RELEASE+x} ]; then
22+
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
23+
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
24+
fi
25+
26+
if [[ ! -e /usr/bin/calibre-server ]] || [[ "${CALIBRE_RELEASE}" != "$(cat /config/.CALIBRE_RELEASE || :)" ]]; then
2127
tar xf \
2228
/tmp/calibre.txz \
2329
-C /app/calibre
2430
rm /tmp/calibre.txz
2531
echo "Installing Calibre version $(cat /CALIBRE_RELEASE)"
2632
/app/calibre/calibre_postinstall
33+
echo "${CALIBRE_RELEASE}" > /config/.CALIBRE_RELEASE
2734
fi

0 commit comments

Comments
 (0)