@@ -18,7 +18,7 @@ add_stream_block() {
1818 entrypoint_log " $ME : $conffile contains a stream block; include $stream_output_dir /*.conf to enable stream templates"
1919 else
2020 # check if the file can be modified, e.g. not on a r/o filesystem
21- touch " $conffile " 2> /dev/null || { entrypoint_log " $ME : ERROR: can not modify $conffile (read-only file system?)" ; return 0; }
21+ touch " $conffile " 2> /dev/null || { entrypoint_log " $ME : ERROR: can not modify $conffile (read-only file system?)" ; exit 0; }
2222 entrypoint_log " $ME : info: Appending stream block to $conffile to include $stream_output_dir /*.conf"
2323 cat << END >> "$conffile "
2424# added by "$ME " on "$( date) "
@@ -38,15 +38,15 @@ auto_envsubst() {
3838 local filter=" ${NGINX_ENVSUBST_FILTER:- } "
3939 local template defined_envs relative_path output_path subdir
4040
41- defined_envs=$( printf " %s" " $( awk " END { for (name in ENVIRON) { print ( name ~ /${filter} / ) ? name : \"\" } }" < /dev/null ) " )
41+ defined_envs=$( printf " %s " " $( awk " END { for (name in ENVIRON) { print ( name ~ /${filter} / ) ? name : \"\" } }" < /dev/null ) " )
4242 [ -d " $template_dir " ] || return 0
4343 if [ ! -w " $output_dir " ]; then
4444 entrypoint_log " $ME : ERROR: $template_dir exists, but $output_dir is not writable"
4545 return 0
4646 fi
4747 find " $template_dir " -follow -type f -name " *$suffix " -print | while read -r template; do
48- relative_path=" ${template# " $template_dir " / } "
49- output_path=" $output_dir /${relative_path% " $suffix " } "
48+ relative_path=" ${template# $template_dir / } "
49+ output_path=" $output_dir /${relative_path% $suffix } "
5050 subdir=$( dirname " $relative_path " )
5151 # create a subdirectory where the template file exists
5252 mkdir -p " $output_dir /$subdir "
@@ -63,8 +63,8 @@ auto_envsubst() {
6363 fi
6464 add_stream_block
6565 find " $template_dir " -follow -type f -name " *$stream_suffix " -print | while read -r template; do
66- relative_path=" ${template# " $template_dir " / } "
67- output_path=" $stream_output_dir /${relative_path% " $stream_suffix " } "
66+ relative_path=" ${template# $template_dir / } "
67+ output_path=" $stream_output_dir /${relative_path% $stream_suffix } "
6868 subdir=$( dirname " $relative_path " )
6969 # create a subdirectory where the template file exists
7070 mkdir -p " $stream_output_dir /$subdir "
0 commit comments