@@ -18,7 +18,7 @@ add_stream_block() {
18
18
entrypoint_log " $ME : $conffile contains a stream block; include $stream_output_dir /*.conf to enable stream templates"
19
19
else
20
20
# 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; }
22
22
entrypoint_log " $ME : info: Appending stream block to $conffile to include $stream_output_dir /*.conf"
23
23
cat << END >> "$conffile "
24
24
# added by "$ME " on "$( date) "
@@ -38,15 +38,15 @@ auto_envsubst() {
38
38
local filter=" ${NGINX_ENVSUBST_FILTER:- } "
39
39
local template defined_envs relative_path output_path subdir
40
40
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 ) " )
42
42
[ -d " $template_dir " ] || return 0
43
43
if [ ! -w " $output_dir " ]; then
44
44
entrypoint_log " $ME : ERROR: $template_dir exists, but $output_dir is not writable"
45
45
return 0
46
46
fi
47
47
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 } "
50
50
subdir=$( dirname " $relative_path " )
51
51
# create a subdirectory where the template file exists
52
52
mkdir -p " $output_dir /$subdir "
@@ -63,8 +63,8 @@ auto_envsubst() {
63
63
fi
64
64
add_stream_block
65
65
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 } "
68
68
subdir=$( dirname " $relative_path " )
69
69
# create a subdirectory where the template file exists
70
70
mkdir -p " $stream_output_dir /$subdir "
0 commit comments