Skip to content

Commit df1e55e

Browse files
authored
remove validators dir in bn if exists (#18)
1 parent fa92f8b commit df1e55e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

beacon-chain/entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ JWT_SECRET=$(get_jwt_secret_by_network "${NETWORK}")
1313
touch "${JWT_FILE_PATH}"
1414
echo "${JWT_SECRET}" >"${JWT_FILE_PATH}"
1515

16+
# Ensure the removal of ${DATA_DIR}/validators if it exists
17+
if [ -d "${DATA_DIR}/validators" ]; then
18+
echo "[INFO - entrypoint] Found existing validators directory at ${DATA_DIR}/validators. Removing it."
19+
if rm -rf "${DATA_DIR}/validators"; then
20+
echo "[INFO - entrypoint] Successfully removed ${DATA_DIR}/validators."
21+
else
22+
echo "[ERROR - entrypoint] Failed to remove ${DATA_DIR}/validators. Exiting."
23+
exit 1
24+
fi
25+
else
26+
echo "[INFO - entrypoint] No validators directory found. Proceeding."
27+
fi
28+
1629
if [ -n "$(ls -A "${DATA_DIR}/db" 2>/dev/null)" ]; then
1730
echo "[INFO - entrypoint] Data directory has already been initialized, skipping checkpoint sync."
1831

0 commit comments

Comments
 (0)