From 97e7a14b6c1611297ae5df0005c2d9e020ec7e3e Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Thu, 12 Oct 2023 00:17:01 +0100 Subject: [PATCH] fix(entrypoint): allow to create a dir and file with a single variable --- docker/entrypoint.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 66b8f586586..1271e01a982 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -90,8 +90,7 @@ fi # Users have to opt-in to additional functionality by setting environmental variables. if [[ -n "${ZEBRA_CONF_PATH}" ]] && [[ ! -f "${ZEBRA_CONF_PATH}" ]] && [[ -z "${ENTRYPOINT_FEATURES}" ]]; then # Create the conf path and file - mkdir -p "${ZEBRA_CONF_DIR}" || { echo "Error creating directory ${ZEBRA_CONF_DIR}"; exit 1; } - touch "${ZEBRA_CONF_PATH}" || { echo "Error creating file ${ZEBRA_CONF_PATH}"; exit 1; } + (mkdir -p "$(dirname "${ZEBRA_CONF_PATH}")" && touch "${ZEBRA_CONF_PATH}") || { echo "Error creating file ${ZEBRA_CONF_PATH}"; exit 1; } # Populate the conf file cat < "${ZEBRA_CONF_PATH}" [network]