From 5efaf083fc096580321fa31b28ddcf3ff1bed1e2 Mon Sep 17 00:00:00 2001 From: Anes Belfodil Date: Thu, 21 Jan 2021 10:45:30 -0500 Subject: [PATCH] Early exit if can't read file --- root/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/entrypoint.sh b/root/entrypoint.sh index 4815fda..fd18d39 100755 --- a/root/entrypoint.sh +++ b/root/entrypoint.sh @@ -4,7 +4,7 @@ FILE_ENV_VARS="$(env | grep '__FILE=')" for env_var in $FILE_ENV_VARS; do var_name="$(echo $env_var | grep -o '.*__FILE=' | sed 's/__FILE=//g')" file_path="$(echo $env_var | grep -o '__FILE=.*' | sed 's/__FILE=//g')" - file_content="$(cat $file_path)" + file_content="$(cat $file_path || exit 1)" new_var="$(echo $var_name=$file_content)" export $(echo $new_var | xargs) done