baseimage-alpine/root/etc/s6-overlay/s6-rc.d/init-envfile/run
2022-10-05 18:03:45 +01:00

18 lines
638 B
Plaintext
Executable file

#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then
for FILENAME in /run/s6/container_environment/*; do
if [[ "${FILENAME##*/}" == "FILE__"* ]]; then
SECRETFILE=$(cat "${FILENAME}")
if [[ -f ${SECRETFILE} ]]; then
FILESTRIP=${FILENAME//FILE__/}
cat "${SECRETFILE}" >"${FILESTRIP}"
echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
else
echo "[env-init] cannot find secret in ${FILENAME##*/}"
fi
fi
done
fi