From 017963912edfa26d97cdccfeabcc66ab8430ac5b Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 2 Jul 2021 17:24:50 +0200 Subject: [PATCH] Use Jellyfin API to get current version --- github/check.jellyfin.update | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/github/check.jellyfin.update b/github/check.jellyfin.update index e38ffdc..c6876e8 100755 --- a/github/check.jellyfin.update +++ b/github/check.jellyfin.update @@ -8,7 +8,7 @@ ### cf. https://git.101010.fr/gardouille-dotfiles/scripts/github/releasetags # wget https://git.101010.fr/gardouille-dotfiles/scripts/raw/branch/master/github/releasetags ### 2. Create a cron job with Jellyfin URL as first argument, eg. -#00 20 * * * root /opt/repos/ipr.scripts/github/check_jellyfin_update https://jellyfin.domain.tld:port/web/index.html +#00 20 * * * root /opt/repos/ipr.scripts/github/check_jellyfin_update http://jellyfin.domain.tld:port/System/Info/Public ### 3. Monitor the temp file : /tmp/.github.jellyfin.upgrade # Or enable MAILTO in cronjob and edit the script to print a message. # Or send a mail. @@ -39,8 +39,8 @@ usage: $PROGNAME [-d|-f|-h|-u|] Compare current version of an installed Jellyfin site and the last available. EXAMPLE : - - Compare the current version installed on http://jellyfin.domain.tld:port/web/index.html - check.jellyfin.update http://jellyfin.domain.tld:port/web/index.html + - Compare the current version installed on http://jellyfin.domain.tld:port + check.jellyfin.update http://jellyfin.domain.tld:port/System/Info/Public OPTIONS : -f,--file @@ -98,7 +98,9 @@ define_vars() { # {{{ fi ## }}} - jellyfin_current_version=$(curl --silent "${jellyfin_url:=/dev/null}" | \grep -oP "(?<=Version=')[[:alnum:].]*") + ## TODO: Use --no-progress-meter instead of --silent + ## when curl 7.74.x will be available on Debian Stable + jellyfin_current_version=$(curl --silent "${jellyfin_url:=/dev/null}" | \grep -oP '(?<=Version":")[[:alnum:].]*') jellyfin_new_version=$("${script_wd}"/releasetags "${jellyfin_repo_url}" | grep -vE -- '(dev|rc)' | head -n1 | sed 's/v//') @@ -123,7 +125,7 @@ Create ${jellyfin_new_version_file} temp file to monitore." else debug_message "Test Jellyfin version − \ -The current version is up-to-date." +The current version (${jellyfin_current_version}) is up-to-date." rm -f -- "${jellyfin_new_version_file}" fi ## }}}