From bf256aa5a77ed94115eb7496a3128733fe0b3bf3 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 14 Sep 2022 22:38:41 +0100 Subject: [PATCH 1/3] If docker version env var is set, store it in /etc/pihole/versions file for later use Signed-off-by: Adam Warner --- advanced/Scripts/updatecheck.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index 37211cc6..f003739b 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -84,4 +84,8 @@ else FTL_VERSION="$(pihole-FTL version)" addOrEditKeyValPair "${VERSION_FILE}" "FTL_VERSION" "${FTL_VERSION}" + if [[ "${PIHOLE_DOCKER_TAG}" ]]; then + addOrEditKeyValPair "${VERSION_FILE}" "DOCKER_VERSION" "${PIHOLE_DOCKER_TAG}" + fi + fi From 760325eb76f3a518b818abfb6e546284e9fa66e1 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 14 Sep 2022 22:49:37 +0100 Subject: [PATCH 2/3] Update piholeDebug to source versions file for DOCKER_VERSION instead of reading PIHOLE_DOCKER_TAG Signed-off-by: Adam Warner --- advanced/Scripts/piholeDebug.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 6543efbb..d016b24d 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -41,6 +41,9 @@ else #OVER="\r\033[K" fi +# shellcheck disable=SC1091 +. /etc/pihole/versions + OBFUSCATED_PLACEHOLDER="" # FAQ URLs for use in showing the debug log @@ -465,8 +468,8 @@ diagnose_operating_system() { # Display the current test that is running echo_current_diagnostic "Operating system" - # If the PIHOLE_DOCKER_TAG variable is set, include this information in the debug output - [ -n "${PIHOLE_DOCKER_TAG}" ] && log_write "${INFO} Pi-hole Docker Container: ${PIHOLE_DOCKER_TAG}" + # If DOCKER_VERSION is set (Sourced from /etc/pihole/versions at start of script), include this information in the debug output + [ -n "${DOCKER_VERSION}" ] && log_write "${INFO} Pi-hole Docker Container: ${DOCKER_VERSION}" # If there is a /etc/*release file, it's probably a supported operating system, so we can if ls /etc/*release 1> /dev/null 2>&1; then @@ -802,7 +805,7 @@ check_networking() { ping_gateway "6" # Skip the following check if installed in docker container. Unpriv'ed containers do not have access to the information required # to resolve the service name listening - and the container should not start if there was a port conflict anyway - [ -z "${PIHOLE_DOCKER_TAG}" ] && check_required_ports + [ -z "${DOCKER_VERSION}" ] && check_required_ports } check_x_headers() { From 3d53bda1211f29312cf722d9bd95739675c2aacf Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 15 Sep 2022 17:54:54 +0100 Subject: [PATCH 3/3] Update advanced/Scripts/updatecheck.sh Co-authored-by: yubiuser Signed-off-by: Adam Warner --- advanced/Scripts/updatecheck.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index f003739b..b1e111ae 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -84,6 +84,7 @@ else FTL_VERSION="$(pihole-FTL version)" addOrEditKeyValPair "${VERSION_FILE}" "FTL_VERSION" "${FTL_VERSION}" + # PIHOLE_DOCKER_TAG is set as env variable only on docker installations if [[ "${PIHOLE_DOCKER_TAG}" ]]; then addOrEditKeyValPair "${VERSION_FILE}" "DOCKER_VERSION" "${PIHOLE_DOCKER_TAG}" fi