diff --git a/install/production-filesystem/entrypoint.d/20-first-run-db.sh b/install/production-filesystem/entrypoint.d/20-first-run-db.sh index a9f8bf09..905efcfb 100755 --- a/install/production-filesystem/entrypoint.d/20-first-run-db.sh +++ b/install/production-filesystem/entrypoint.d/20-first-run-db.sh @@ -11,10 +11,21 @@ RESET=$(printf '\033[0m') # Ensure DB folder exists if [ ! -d "${NETALERTX_DB}" ]; then - mkdir -p "${NETALERTX_DB}" || { - >&2 echo "ERROR: Failed to create DB directory at ${NETALERTX_DB}" + if ! mkdir -p "${NETALERTX_DB}"; then + >&2 printf "%s" "${RED}" + >&2 cat <&2 printf "%s" "${RESET}" exit 1 - } + fi chmod 700 "${NETALERTX_DB}" 2>/dev/null || true fi