diff --git a/entrypoint/15-local-resolvers.envsh b/entrypoint/15-local-resolvers.envsh index d3beae9c..da963525 100755 --- a/entrypoint/15-local-resolvers.envsh +++ b/entrypoint/15-local-resolvers.envsh @@ -6,7 +6,7 @@ set -eu LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || exit 0 +[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) export NGINX_LOCAL_RESOLVERS diff --git a/entrypoint/20-envsubst-on-templates.sh b/entrypoint/20-envsubst-on-templates.sh index 64dacd34..26111e0f 100755 --- a/entrypoint/20-envsubst-on-templates.sh +++ b/entrypoint/20-envsubst-on-templates.sh @@ -18,7 +18,7 @@ add_stream_block() { entrypoint_log "$ME: $conffile contains a stream block; include $stream_output_dir/*.conf to enable stream templates" else # check if the file can be modified, e.g. not on a r/o filesystem - touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; return 0; } + touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; exit 0; } entrypoint_log "$ME: info: Appending stream block to $conffile to include $stream_output_dir/*.conf" cat << END >> "$conffile" # added by "$ME" on "$(date)" @@ -45,8 +45,8 @@ auto_envsubst() { return 0 fi find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$output_dir/${relative_path%"$suffix"}" + relative_path="${template#$template_dir/}" + output_path="$output_dir/${relative_path%$suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$output_dir/$subdir" @@ -63,8 +63,8 @@ auto_envsubst() { fi add_stream_block find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$stream_output_dir/${relative_path%"$stream_suffix"}" + relative_path="${template#$template_dir/}" + output_path="$stream_output_dir/${relative_path%$stream_suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$stream_output_dir/$subdir" diff --git a/mainline/alpine-slim/15-local-resolvers.envsh b/mainline/alpine-slim/15-local-resolvers.envsh index d3beae9c..da963525 100755 --- a/mainline/alpine-slim/15-local-resolvers.envsh +++ b/mainline/alpine-slim/15-local-resolvers.envsh @@ -6,7 +6,7 @@ set -eu LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || exit 0 +[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) export NGINX_LOCAL_RESOLVERS diff --git a/mainline/alpine-slim/20-envsubst-on-templates.sh b/mainline/alpine-slim/20-envsubst-on-templates.sh index 64dacd34..26111e0f 100755 --- a/mainline/alpine-slim/20-envsubst-on-templates.sh +++ b/mainline/alpine-slim/20-envsubst-on-templates.sh @@ -18,7 +18,7 @@ add_stream_block() { entrypoint_log "$ME: $conffile contains a stream block; include $stream_output_dir/*.conf to enable stream templates" else # check if the file can be modified, e.g. not on a r/o filesystem - touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; return 0; } + touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; exit 0; } entrypoint_log "$ME: info: Appending stream block to $conffile to include $stream_output_dir/*.conf" cat << END >> "$conffile" # added by "$ME" on "$(date)" @@ -45,8 +45,8 @@ auto_envsubst() { return 0 fi find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$output_dir/${relative_path%"$suffix"}" + relative_path="${template#$template_dir/}" + output_path="$output_dir/${relative_path%$suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$output_dir/$subdir" @@ -63,8 +63,8 @@ auto_envsubst() { fi add_stream_block find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$stream_output_dir/${relative_path%"$stream_suffix"}" + relative_path="${template#$template_dir/}" + output_path="$stream_output_dir/${relative_path%$stream_suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$stream_output_dir/$subdir" diff --git a/mainline/debian/15-local-resolvers.envsh b/mainline/debian/15-local-resolvers.envsh index d3beae9c..da963525 100755 --- a/mainline/debian/15-local-resolvers.envsh +++ b/mainline/debian/15-local-resolvers.envsh @@ -6,7 +6,7 @@ set -eu LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || exit 0 +[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) export NGINX_LOCAL_RESOLVERS diff --git a/mainline/debian/20-envsubst-on-templates.sh b/mainline/debian/20-envsubst-on-templates.sh index 64dacd34..26111e0f 100755 --- a/mainline/debian/20-envsubst-on-templates.sh +++ b/mainline/debian/20-envsubst-on-templates.sh @@ -18,7 +18,7 @@ add_stream_block() { entrypoint_log "$ME: $conffile contains a stream block; include $stream_output_dir/*.conf to enable stream templates" else # check if the file can be modified, e.g. not on a r/o filesystem - touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; return 0; } + touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; exit 0; } entrypoint_log "$ME: info: Appending stream block to $conffile to include $stream_output_dir/*.conf" cat << END >> "$conffile" # added by "$ME" on "$(date)" @@ -45,8 +45,8 @@ auto_envsubst() { return 0 fi find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$output_dir/${relative_path%"$suffix"}" + relative_path="${template#$template_dir/}" + output_path="$output_dir/${relative_path%$suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$output_dir/$subdir" @@ -63,8 +63,8 @@ auto_envsubst() { fi add_stream_block find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$stream_output_dir/${relative_path%"$stream_suffix"}" + relative_path="${template#$template_dir/}" + output_path="$stream_output_dir/${relative_path%$stream_suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$stream_output_dir/$subdir" diff --git a/stable/alpine-slim/15-local-resolvers.envsh b/stable/alpine-slim/15-local-resolvers.envsh index d3beae9c..da963525 100755 --- a/stable/alpine-slim/15-local-resolvers.envsh +++ b/stable/alpine-slim/15-local-resolvers.envsh @@ -6,7 +6,7 @@ set -eu LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || exit 0 +[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) export NGINX_LOCAL_RESOLVERS diff --git a/stable/alpine-slim/20-envsubst-on-templates.sh b/stable/alpine-slim/20-envsubst-on-templates.sh index 64dacd34..26111e0f 100755 --- a/stable/alpine-slim/20-envsubst-on-templates.sh +++ b/stable/alpine-slim/20-envsubst-on-templates.sh @@ -18,7 +18,7 @@ add_stream_block() { entrypoint_log "$ME: $conffile contains a stream block; include $stream_output_dir/*.conf to enable stream templates" else # check if the file can be modified, e.g. not on a r/o filesystem - touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; return 0; } + touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; exit 0; } entrypoint_log "$ME: info: Appending stream block to $conffile to include $stream_output_dir/*.conf" cat << END >> "$conffile" # added by "$ME" on "$(date)" @@ -45,8 +45,8 @@ auto_envsubst() { return 0 fi find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$output_dir/${relative_path%"$suffix"}" + relative_path="${template#$template_dir/}" + output_path="$output_dir/${relative_path%$suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$output_dir/$subdir" @@ -63,8 +63,8 @@ auto_envsubst() { fi add_stream_block find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$stream_output_dir/${relative_path%"$stream_suffix"}" + relative_path="${template#$template_dir/}" + output_path="$stream_output_dir/${relative_path%$stream_suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$stream_output_dir/$subdir" diff --git a/stable/debian/15-local-resolvers.envsh b/stable/debian/15-local-resolvers.envsh index d3beae9c..da963525 100755 --- a/stable/debian/15-local-resolvers.envsh +++ b/stable/debian/15-local-resolvers.envsh @@ -6,7 +6,7 @@ set -eu LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || exit 0 +[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0 NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) export NGINX_LOCAL_RESOLVERS diff --git a/stable/debian/20-envsubst-on-templates.sh b/stable/debian/20-envsubst-on-templates.sh index 64dacd34..26111e0f 100755 --- a/stable/debian/20-envsubst-on-templates.sh +++ b/stable/debian/20-envsubst-on-templates.sh @@ -18,7 +18,7 @@ add_stream_block() { entrypoint_log "$ME: $conffile contains a stream block; include $stream_output_dir/*.conf to enable stream templates" else # check if the file can be modified, e.g. not on a r/o filesystem - touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; return 0; } + touch "$conffile" 2>/dev/null || { entrypoint_log "$ME: ERROR: can not modify $conffile (read-only file system?)"; exit 0; } entrypoint_log "$ME: info: Appending stream block to $conffile to include $stream_output_dir/*.conf" cat << END >> "$conffile" # added by "$ME" on "$(date)" @@ -45,8 +45,8 @@ auto_envsubst() { return 0 fi find "$template_dir" -follow -type f -name "*$suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$output_dir/${relative_path%"$suffix"}" + relative_path="${template#$template_dir/}" + output_path="$output_dir/${relative_path%$suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$output_dir/$subdir" @@ -63,8 +63,8 @@ auto_envsubst() { fi add_stream_block find "$template_dir" -follow -type f -name "*$stream_suffix" -print | while read -r template; do - relative_path="${template#"$template_dir"/}" - output_path="$stream_output_dir/${relative_path%"$stream_suffix"}" + relative_path="${template#$template_dir/}" + output_path="$stream_output_dir/${relative_path%$stream_suffix}" subdir=$(dirname "$relative_path") # create a subdirectory where the template file exists mkdir -p "$stream_output_dir/$subdir"