From 3d17dc47b5091b4db360ccae6ff6a7f58096a8c6 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Thu, 4 Dec 2025 10:22:34 +1100 Subject: [PATCH] BE: ensure /db - better error #1327 Signed-off-by: jokob-sk --- .../entrypoint.d/20-first-run-db.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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