#!/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="${stream_confload} $i" 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}" NGX_STREAM_CONFLOAD=$(sort_dedup_list "${stream_confload}") set +a unset stream_modules stream_confload fi