From 8ad3624b2493d95380d6cd465d739f6303a0793d Mon Sep 17 00:00:00 2001 From: Salim B Date: Wed, 15 May 2024 23:57:10 +0200 Subject: [PATCH] fix: make start scripts more robust --- packages/nocodb/docker/start-litestream.sh | 8 +++----- packages/nocodb/docker/start-local.sh | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/nocodb/docker/start-litestream.sh b/packages/nocodb/docker/start-litestream.sh index da66e5480b..046a841a47 100644 --- a/packages/nocodb/docker/start-litestream.sh +++ b/packages/nocodb/docker/start-litestream.sh @@ -1,8 +1,6 @@ #!/bin/sh -#sleep 5 - -if [ -n "${NC_TOOL_DIR}" ]; then +if [ ! -d "${NC_TOOL_DIR}" ] ; then mkdir -p "$NC_TOOL_DIR" fi @@ -10,8 +8,8 @@ if [ -n "${LITESTREAM_S3_ENDPOINT}" ] && [ -n "${LITESTREAM_S3_BUCKET}" ] && [ - if [ -f "${NC_TOOL_DIR}noco.db" ] ; then rm "${NC_TOOL_DIR}noco.db" - rm "${NC_TOOL_DIR}noco.db-shm" - rm "${NC_TOOL_DIR}noco.db-wal" + rm -f "${NC_TOOL_DIR}noco.db-shm" + rm -f "${NC_TOOL_DIR}noco.db-wal" fi litestream restore "${NC_TOOL_DIR}noco.db" diff --git a/packages/nocodb/docker/start-local.sh b/packages/nocodb/docker/start-local.sh index 3dd17d0d04..faaeece178 100644 --- a/packages/nocodb/docker/start-local.sh +++ b/packages/nocodb/docker/start-local.sh @@ -1,6 +1,6 @@ #!/bin/sh -if [ -n "${NC_TOOL_DIR}" ]; then +if [ ! -d "${NC_TOOL_DIR}" ]; then mkdir -p "$NC_TOOL_DIR" fi