瀏覽代碼

Allow user skip unbound healthcheck

KagurazakaNyaa 1 年之前
父節點
當前提交
ed493f9c3a
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 10 0
      data/Dockerfiles/unbound/healthcheck.sh
  2. 4 0
      generate_config.sh

+ 10 - 0
data/Dockerfiles/unbound/healthcheck.sh

@@ -1,5 +1,10 @@
 #!/bin/bash
 
+# Skipping DNS check
+if [[ "${SKIP_DNS_CHECK}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
+    SKIP_DNS_CHECK=y
+fi
+
 # Declare log function for logfile inside container
 function log_to_file() {
     echo "$(date +"%Y-%m-%d %H:%M:%S"): $1" > /var/log/healthcheck.log
@@ -66,6 +71,11 @@ function check_netcat() {
 
 }
 
+if [[ ${SKIP_DNS_CHECK} == "y" ]]; then
+    log_to_file "Healthcheck: ALL CHECKS WERE SKIPPED! Unbound is healthy!"
+    exit 0
+fi
+
 # run checks, if check is not returning 0 (return value if check is ok), healthcheck will exit with 1 (marked in docker as unhealthy)
 check_ping
 

+ 4 - 0
generate_config.sh

@@ -363,6 +363,10 @@ SKIP_IP_CHECK=n
 
 SKIP_HTTP_VERIFICATION=n
 
+# Skip DNS check in Unbound container - y/n
+
+SKIP_DNS_CHECK=n
+
 # Skip ClamAV (clamd-mailcow) anti-virus (Rspamd will auto-detect a missing ClamAV container) - y/n
 
 SKIP_CLAMD=${SKIP_CLAMD}