2024-07-15 16:15:47 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "${NGX_STREAM}" = 1 ] ; then
|
|
|
|
unset stream_modules stream_snippets
|
|
|
|
stream_modules=
|
|
|
|
stream_snippets="${NGX_STREAM_SNIPPETS:-}"
|
|
|
|
|
|
|
|
## filter out builtin stream modules
|
|
|
|
unset i
|
|
|
|
for i in ${NGX_STREAM_MODULES:-} ; do
|
|
|
|
[ -n "$i" ] || continue
|
|
|
|
|
|
|
|
if is_builtin_module stream "$i" ; then
|
|
|
|
log "$i is builtin module, moving to snippets"
|
2024-07-20 16:35:39 +03:00
|
|
|
stream_snippets="${stream_snippets} $i"
|
2024-07-15 16:15:47 +03:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
## naive deduplication
|
|
|
|
case " ${stream_modules} " in
|
|
|
|
*" $i "* )
|
|
|
|
log "$i is already specified"
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
stream_modules="${stream_modules}${stream_modules:+ }$i"
|
|
|
|
done
|
|
|
|
unset i
|
|
|
|
|
|
|
|
set -a
|
|
|
|
NGX_STREAM_MODULES="${stream_modules}"
|
2024-07-20 16:35:39 +03:00
|
|
|
NGX_STREAM_SNIPPETS=$(sort_dedup_list "${stream_snippets}")
|
2024-07-15 16:15:47 +03:00
|
|
|
set +a
|
|
|
|
|
|
|
|
unset stream_modules stream_snippets
|
|
|
|
fi
|