2024-07-15 16:15:47 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "${NGX_STREAM}" = 1 ] ; then
|
2024-07-23 21:59:49 +03:00
|
|
|
unset stream_modules stream_confload
|
2024-07-15 16:15:47 +03:00
|
|
|
stream_modules=
|
2024-07-23 21:59:49 +03:00
|
|
|
stream_confload="${NGX_STREAM_CONFLOAD:-}"
|
2024-07-15 16:15:47 +03:00
|
|
|
|
|
|
|
## filter out builtin stream modules
|
|
|
|
unset i
|
|
|
|
for i in ${NGX_STREAM_MODULES:-} ; do
|
|
|
|
[ -n "$i" ] || continue
|
|
|
|
|
2024-07-24 22:47:53 +03:00
|
|
|
case "$i" in
|
|
|
|
*/* | *\** | *\?* )
|
|
|
|
log_always "module '$i' is not legal, skipping"
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2024-07-15 16:15:47 +03:00
|
|
|
if is_builtin_module stream "$i" ; then
|
2024-07-24 22:47:53 +03:00
|
|
|
log "$i is builtin module, moving to NGX_STREAM_CONFLOAD"
|
2024-07-23 21:59:49 +03:00
|
|
|
stream_confload="${stream_confload} $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-23 21:59:49 +03:00
|
|
|
NGX_STREAM_CONFLOAD=$(sort_dedup_list "${stream_confload}")
|
2024-07-15 16:15:47 +03:00
|
|
|
set +a
|
|
|
|
|
2024-07-23 21:59:49 +03:00
|
|
|
unset stream_modules stream_confload
|
2024-07-15 16:15:47 +03:00
|
|
|
fi
|