File tree Expand file tree Collapse file tree 3 files changed +19
-19
lines changed
root/etc/s6-overlay/s6-rc.d Expand file tree Collapse file tree 3 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/with-contenv bash
2- # shellcheck shell=bash
3-
4- if find /run/s6/container_environment/FILE__* -maxdepth 1 > /dev/null 2>&1; then
5- for FILENAME in /run/s6/container_environment/FILE__*; do
6- SECRETFILE=$(cat "${FILENAME}")
7- if [[ -f ${SECRETFILE} ]]; then
8- FILESTRIP=${FILENAME//FILE__/}
9- if [[ $(tail -n1 "${SECRETFILE}" | wc -l) != 0 ]]; then
10- echo "[env-init] Your secret: ${FILENAME##*/}"
11- echo " contains a trailing newline and may not work as expected"
12- fi
13- cat "${SECRETFILE}" >"${FILESTRIP}"
14- echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
15- else
16- echo "[env-init] cannot find secret in ${FILENAME##*/}"
17- fi
18- done
19- fi
1+ #!/usr/bin/with-contenv bash
2+ # shellcheck shell=bash
3+
4+ if find /run/s6/container_environment/FILE__* -maxdepth 1 > /dev/null 2>&1; then
5+ for FILENAME in /run/s6/container_environment/FILE__*; do
6+ SECRETFILE=$(cat "${FILENAME}")
7+ if [[ -f ${SECRETFILE} ]]; then
8+ FILESTRIP=${FILENAME//FILE__/}
9+ if [[ $(tail -n1 "${SECRETFILE}" | wc -l) != 0 ]]; then
10+ echo "[env-init] Your secret: ${FILENAME##*/}"
11+ echo " contains a trailing newline and may not work as expected"
12+ fi
13+ cat "${SECRETFILE}" >"${FILESTRIP}"
14+ echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
15+ else
16+ echo "[env-init] cannot find secret in ${FILENAME##*/}"
17+ fi
18+ done
19+ fi
You can’t perform that action at this time.
0 commit comments