File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
root/etc/s6-overlay/s6-rc.d/init-envfile Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22# shellcheck shell=bash
33
4- if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then
5- for FILENAME in /run/s6/container_environment/*; do
6- if [[ "${FILENAME##*/}" == "FILE__"* ]]; then
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
76 SECRETFILE=$(cat "${FILENAME}")
87 if [[ -f ${SECRETFILE} ]]; then
98 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
1013 cat "${SECRETFILE}" >"${FILESTRIP}"
1114 echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}"
1215 else
1316 echo "[env-init] cannot find secret in ${FILENAME##*/}"
1417 fi
15- fi
1618 done
1719fi
You can’t perform that action at this time.
0 commit comments