From 02a55ce9db2e15e444cbc53413d5dc99da8a68ab Mon Sep 17 00:00:00 2001 From: "Hailer, Christian" Date: Mon, 19 Feb 2024 09:26:29 +0100 Subject: [PATCH] Fix unbound healthcheck.sh to log all messages to logfile --- data/Dockerfiles/unbound/healthcheck.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/Dockerfiles/unbound/healthcheck.sh b/data/Dockerfiles/unbound/healthcheck.sh index 8da79bd77..3da98e245 100644 --- a/data/Dockerfiles/unbound/healthcheck.sh +++ b/data/Dockerfiles/unbound/healthcheck.sh @@ -5,9 +5,13 @@ if [[ "${SKIP_UNBOUND_HEALTHCHECK}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then SKIP_UNBOUND_HEALTHCHECK=y fi +# Reset logfile +echo "$(date +"%Y-%m-%d %H:%M:%S"): Starting health check - logs can be found in /var/log/healthcheck.log" +echo "$(date +"%Y-%m-%d %H:%M:%S"): Starting health check" > /var/log/healthcheck.log + # Declare log function for logfile inside container function log_to_file() { - echo "$(date +"%Y-%m-%d %H:%M:%S"): $1" > /var/log/healthcheck.log + echo "$(date +"%Y-%m-%d %H:%M:%S"): $1" >> /var/log/healthcheck.log } # General Ping function to check general pingability