From 7b19b650d48854d0c96bda78f58d76c90d25b2e1 Mon Sep 17 00:00:00 2001 From: Jack'lul Date: Sun, 26 May 2024 08:38:03 +0200 Subject: [PATCH] Fix version check for release Docker images Signed-off-by: Jack'lul --- advanced/Scripts/updatecheck.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index eda6c403..b325ee9c 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -54,7 +54,8 @@ chmod 644 "${VERSION_FILE}" # if /pihole.docker.tag file exists, we will use it's value later in this script DOCKER_TAG=$(cat /pihole.docker.tag 2>/dev/null) -regex='^([0-9]+\.){1,2}(\*|[0-9]+)(-.*)?$|(^nightly$)|(^dev.*$)' +release_regex='^([0-9]+\.){1,2}(\*|[0-9]+)(-.*)?$' +regex=$release_regex'|(^nightly$)|(^dev.*$)' if [[ ! "${DOCKER_TAG}" =~ $regex ]]; then # DOCKER_TAG does not match the pattern (see https://regex101.com/r/RsENuz/1), so unset it. unset DOCKER_TAG @@ -121,6 +122,12 @@ addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_FTL_HASH" "${GITHUB_FTL_HASH}" if [[ "${DOCKER_TAG}" ]]; then addOrEditKeyValPair "${VERSION_FILE}" "DOCKER_VERSION" "${DOCKER_TAG}" - GITHUB_DOCKER_VERSION="$(get_remote_version docker-pi-hole)" + # Remote version check only if the tag is a valid release version + docker_branch="" + if [[ "${DOCKER_TAG}" =~ $release_regex ]]; then + docker_branch="master" + fi + + GITHUB_DOCKER_VERSION="$(get_remote_version docker-pi-hole "${docker_branch}")" addOrEditKeyValPair "${VERSION_FILE}" "GITHUB_DOCKER_VERSION" "${GITHUB_DOCKER_VERSION}" fi