From 6a79eff8b3af425497b91080ceabde0dd1c73939 Mon Sep 17 00:00:00 2001 From: Steven Foerster Date: Tue, 2 Mar 2021 17:29:48 -0500 Subject: [PATCH] no error when file DNE --- scripts/wrappers/mistborn_docker.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/wrappers/mistborn_docker.sh b/scripts/wrappers/mistborn_docker.sh index 812648d..a40fd74 100755 --- a/scripts/wrappers/mistborn_docker.sh +++ b/scripts/wrappers/mistborn_docker.sh @@ -6,6 +6,7 @@ SERVICE="$1" shift export MISTBORN_HOME="/opt/mistborn" +export MISTBORN_SERVICE_FILE=${MISTBORN_HOME}/.envs/.production/.${SERVICE} # check and create file if needed ${MISTBORN_HOME}/scripts/env/check_env_file.sh ${SERVICE} @@ -13,7 +14,13 @@ ${MISTBORN_HOME}/scripts/env/check_env_file.sh ${SERVICE} # read in variables set -a source ${MISTBORN_HOME}/.env -source ${MISTBORN_HOME}/.envs/.production/.${SERVICE} + +if [[ -f "${MISTBORN_SERVICE_FILE}" ]]; then + echo "Loading service variables" + source ${MISTBORN_SERVICE_FILE} +else + echo "No service variables to load" +fi set +a exec "$@" \ No newline at end of file