initial commit
This commit is contained in:
23
scripts/envsubst-args.sh
Executable file
23
scripts/envsubst-args.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
set -f
|
||||
|
||||
sed -znE '/^([^=]+)=.*$/s,,\1,p' /proc/$$/environ \
|
||||
| sed -zE \
|
||||
-e '/^_$/d' \
|
||||
-e '/^ANGIE(|_BPF_MAPS)$/d' \
|
||||
-e '/^__IEP_/d;/^IEP_$/d' \
|
||||
-e '/^NGX_STATIC_/d' \
|
||||
-e '/^ENVSUBST_/d' \
|
||||
-e '/^J2CFG_/d' \
|
||||
| {
|
||||
if [ -n "${ENVSUBST_EXCLUDE_REGEX:-}" ] ; then
|
||||
grep -zEv -e "${ENVSUBST_EXCLUDE_REGEX}"
|
||||
elif [ -n "${ENVSUBST_INCLUDE_REGEX:-}" ] ; then
|
||||
grep -zE -e "${ENVSUBST_INCLUDE_REGEX}"
|
||||
else
|
||||
cat
|
||||
fi
|
||||
} \
|
||||
| sort -zV \
|
||||
| xargs -0 -r printf '${%s} ' \
|
||||
| sed -zE 's/ $//'
|
Reference in New Issue
Block a user