1
0
angie-conv-image/image-entry.d/41-stream-modules.envsh

43 lines
912 B
Plaintext
Raw Permalink Normal View History

2024-09-17 14:11:00 +03:00
#!/bin/sh
if [ "${NGX_STREAM}" = 1 ] ; then
unset stream_modules stream_confload
stream_modules=
stream_confload="${NGX_STREAM_CONFLOAD:-}"
## filter out builtin stream modules
unset i
for i in ${NGX_STREAM_MODULES:-} ; do
[ -n "$i" ] || continue
case "$i" in
*/* | *\** | *\?* )
log_always "module '$i' is not legal, skipping"
continue
;;
esac
if is_builtin_module stream "$i" ; then
log "$i is builtin module, moving to NGX_STREAM_CONFLOAD"
stream_confload=$(append_list "${stream_confload}" "$i")
continue
fi
## naive deduplication
if list_have_item "${stream_modules}" "$i" ; then
log "$i is already specified"
continue
fi
stream_modules=$(append_list "${stream_modules}" "$i")
done
unset i
set -a
NGX_STREAM_MODULES="${stream_modules}"
NGX_STREAM_CONFLOAD=$(sort_dedup_list "${stream_confload}")
set +a
unset stream_modules stream_confload
fi