fix: ensure data directories exist before creating them in Unraid setup
This commit is contained in:
@@ -33,19 +33,15 @@ DATA_PATH="$UNRAID_GITEA_DATA_PATH"
|
||||
# DB helpers and strip_template_block are in lib/common.sh
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Step 1: Create data directories
|
||||
# Step 1: Ensure data directories exist
|
||||
# ---------------------------------------------------------------------------
|
||||
log_step 1 "Creating data directories on Unraid..."
|
||||
if ssh_exec UNRAID "test -d '${DATA_PATH}/data'"; then
|
||||
log_info "Data directory already exists — skipping"
|
||||
log_step 1 "Ensuring data directories on Unraid..."
|
||||
if [[ "${GITEA_DB_TYPE}" != "sqlite3" ]]; then
|
||||
ssh_exec UNRAID "mkdir -p '${DATA_PATH}/data' '${DATA_PATH}/config' '${DATA_PATH}/db'"
|
||||
else
|
||||
ssh_exec UNRAID "mkdir -p '${DATA_PATH}/data' '${DATA_PATH}/config'"
|
||||
# Create DB data directory for external databases
|
||||
if [[ "${GITEA_DB_TYPE}" != "sqlite3" ]]; then
|
||||
ssh_exec UNRAID "mkdir -p '${DATA_PATH}/db'"
|
||||
fi
|
||||
log_success "Data directories created"
|
||||
fi
|
||||
log_success "Data directories ensured"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Step 2: Create macvlan Docker network (idempotent)
|
||||
@@ -128,7 +124,7 @@ fi
|
||||
# Step 5: Start Gitea container
|
||||
# ---------------------------------------------------------------------------
|
||||
log_step 5 "Starting Gitea container..."
|
||||
CONTAINER_STATUS=$(ssh_exec UNRAID "docker ps --filter name=gitea --format '{{.Status}}'" 2>/dev/null || true)
|
||||
CONTAINER_STATUS=$(ssh_exec UNRAID "docker ps --filter 'name=^/gitea$' --format '{{.Status}}'" 2>/dev/null || true)
|
||||
if [[ "$CONTAINER_STATUS" == *"Up"* ]]; then
|
||||
log_info "Gitea container already running — skipping"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user