From 793319d7251c03eccecbf27b60e0cfbbd2d1f400 Mon Sep 17 00:00:00 2001
From: Konstantin Pavlov <thresh@videolan.org>
Date: Fri, 10 Jul 2020 14:23:41 +0300
Subject: [PATCH] Made all entrypoint scripts honour
 NGINX_ENTRYPOINT_QUIET_LOGS in full

Fixes #437
---
 .../alpine-perl/10-listen-on-ipv6-by-default.sh    | 14 +++++++-------
 mainline/alpine-perl/20-envsubst-on-templates.sh   |  2 +-
 mainline/alpine/10-listen-on-ipv6-by-default.sh    | 14 +++++++-------
 mainline/alpine/20-envsubst-on-templates.sh        |  2 +-
 .../buster-perl/10-listen-on-ipv6-by-default.sh    | 14 +++++++-------
 mainline/buster-perl/20-envsubst-on-templates.sh   |  2 +-
 mainline/buster/10-listen-on-ipv6-by-default.sh    | 14 +++++++-------
 mainline/buster/20-envsubst-on-templates.sh        |  2 +-
 stable/alpine-perl/10-listen-on-ipv6-by-default.sh | 14 +++++++-------
 stable/alpine-perl/20-envsubst-on-templates.sh     |  2 +-
 stable/alpine/10-listen-on-ipv6-by-default.sh      | 14 +++++++-------
 stable/alpine/20-envsubst-on-templates.sh          |  2 +-
 stable/buster-perl/10-listen-on-ipv6-by-default.sh | 14 +++++++-------
 stable/buster-perl/20-envsubst-on-templates.sh     |  2 +-
 stable/buster/10-listen-on-ipv6-by-default.sh      | 14 +++++++-------
 stable/buster/20-envsubst-on-templates.sh          |  2 +-
 16 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/mainline/alpine-perl/10-listen-on-ipv6-by-default.sh b/mainline/alpine-perl/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/mainline/alpine-perl/10-listen-on-ipv6-by-default.sh
+++ b/mainline/alpine-perl/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/mainline/alpine-perl/20-envsubst-on-templates.sh b/mainline/alpine-perl/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/mainline/alpine-perl/20-envsubst-on-templates.sh
+++ b/mainline/alpine-perl/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
diff --git a/mainline/alpine/10-listen-on-ipv6-by-default.sh b/mainline/alpine/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/mainline/alpine/10-listen-on-ipv6-by-default.sh
+++ b/mainline/alpine/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/mainline/alpine/20-envsubst-on-templates.sh b/mainline/alpine/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/mainline/alpine/20-envsubst-on-templates.sh
+++ b/mainline/alpine/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
diff --git a/mainline/buster-perl/10-listen-on-ipv6-by-default.sh b/mainline/buster-perl/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/mainline/buster-perl/10-listen-on-ipv6-by-default.sh
+++ b/mainline/buster-perl/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/mainline/buster-perl/20-envsubst-on-templates.sh b/mainline/buster-perl/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/mainline/buster-perl/20-envsubst-on-templates.sh
+++ b/mainline/buster-perl/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
diff --git a/mainline/buster/10-listen-on-ipv6-by-default.sh b/mainline/buster/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/mainline/buster/10-listen-on-ipv6-by-default.sh
+++ b/mainline/buster/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/mainline/buster/20-envsubst-on-templates.sh b/mainline/buster/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/mainline/buster/20-envsubst-on-templates.sh
+++ b/mainline/buster/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
diff --git a/stable/alpine-perl/10-listen-on-ipv6-by-default.sh b/stable/alpine-perl/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/stable/alpine-perl/10-listen-on-ipv6-by-default.sh
+++ b/stable/alpine-perl/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/stable/alpine-perl/20-envsubst-on-templates.sh b/stable/alpine-perl/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/stable/alpine-perl/20-envsubst-on-templates.sh
+++ b/stable/alpine-perl/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
diff --git a/stable/alpine/10-listen-on-ipv6-by-default.sh b/stable/alpine/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/stable/alpine/10-listen-on-ipv6-by-default.sh
+++ b/stable/alpine/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/stable/alpine/20-envsubst-on-templates.sh b/stable/alpine/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/stable/alpine/20-envsubst-on-templates.sh
+++ b/stable/alpine/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
diff --git a/stable/buster-perl/10-listen-on-ipv6-by-default.sh b/stable/buster-perl/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/stable/buster-perl/10-listen-on-ipv6-by-default.sh
+++ b/stable/buster-perl/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/stable/buster-perl/20-envsubst-on-templates.sh b/stable/buster-perl/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/stable/buster-perl/20-envsubst-on-templates.sh
+++ b/stable/buster-perl/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
diff --git a/stable/buster/10-listen-on-ipv6-by-default.sh b/stable/buster/10-listen-on-ipv6-by-default.sh
index 9636f4c..9f73f9d 100755
--- a/stable/buster/10-listen-on-ipv6-by-default.sh
+++ b/stable/buster/10-listen-on-ipv6-by-default.sh
@@ -8,17 +8,17 @@ DEFAULT_CONF_FILE="etc/nginx/conf.d/default.conf"
 
 # check if we have ipv6 available
 if [ ! -f "/proc/net/if_inet6" ]; then
-    echo "$ME: error: ipv6 not available" 1>&2
+    echo >&3 "$ME: error: ipv6 not available"
     exit 0
 fi
 
 if [ ! -f "/$DEFAULT_CONF_FILE" ]; then
-    echo "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist" 1>&2
+    echo >&3 "$ME: error: /$DEFAULT_CONF_FILE is not a file or does not exist"
     exit 0
 fi
 
 # check if the file can be modified, e.g. not on a r/o filesystem
-touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)" 1>&2; exit 0; }
+touch /$DEFAULT_CONF_FILE 2>/dev/null || { echo >&3 "$ME: error: can not modify /$DEFAULT_CONF_FILE (read-only file system?)"; exit 0; }
 
 # check if the file is already modified, e.g. on a container restart
 grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6 listen already enabled"; exit 0; }
@@ -26,7 +26,7 @@ grep -q "listen  \[::]\:80;" /$DEFAULT_CONF_FILE && { echo >&3 "$ME: error: IPv6
 if [ -f "/etc/os-release" ]; then
     . /etc/os-release
 else
-    echo "$ME: error: can not guess the operating system" 1>&2
+    echo >&3 "$ME: error: can not guess the operating system"
     exit 0
 fi
 
@@ -36,19 +36,19 @@ case "$ID" in
     "debian")
         CHECKSUM=$(dpkg-query --show --showformat='${Conffiles}\n' nginx | grep $DEFAULT_CONF_FILE | cut -d' ' -f 3)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | md5sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packaged version"
             exit 0
         }
         ;;
     "alpine")
         CHECKSUM=$(apk manifest nginx 2>/dev/null| grep $DEFAULT_CONF_FILE | cut -d' ' -f 1 | cut -d ':' -f 2)
         echo "$CHECKSUM  /$DEFAULT_CONF_FILE" | sha1sum -c - >/dev/null 2>&1 || {
-            echo "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version" 1>&2
+            echo >&3 "$ME: error: /$DEFAULT_CONF_FILE differs from the packages version"
             exit 0
         }
         ;;
     *)
-        echo "$ME: error: Unsupported distribution" 1>&2
+        echo >&3 "$ME: error: Unsupported distribution"
         exit 0
         ;;
 esac
diff --git a/stable/buster/20-envsubst-on-templates.sh b/stable/buster/20-envsubst-on-templates.sh
index 545c765..4f33029 100755
--- a/stable/buster/20-envsubst-on-templates.sh
+++ b/stable/buster/20-envsubst-on-templates.sh
@@ -13,7 +13,7 @@ auto_envsubst() {
   defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
   [ -d "$template_dir" ] || return 0
   if [ ! -w "$output_dir" ]; then
-    echo "$ME: ERROR: $template_dir exists, but $output_dir is not writable" 1>&2
+    echo >&3 "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
     return 0
   fi
   find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do
-- 
GitLab