Skip to content

Commit

Permalink
fix(entrypoint): allow to create a dir and file with a single variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavovalverde committed Oct 11, 2023
1 parent 6fe2870 commit 97e7a14
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > "${ZEBRA_CONF_PATH}"
[network]
Expand Down

0 comments on commit 97e7a14

Please sign in to comment.