Skip to content
Snippets Groups Projects
Commit fcf1ffc1 authored by thelamer's avatar thelamer Committed by Ryan Kuba
Browse files

inital logic to load env files from a specific identifier FILE__

parent f54ee2a8
No related branches found
No related tags found
No related merge requests found
#! /bin/bash
if [[ "$(ls /var/run/s6/container_environment/ | xargs)" == *"FILE__"* ]]; then
for FILENAME in /var/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment