From 27efbc3485bd2c44a1f81e402d253a52d520ee0b Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Mon, 29 Nov 2021 13:52:06 -0800 Subject: [PATCH] fix logic error --- scripts/docker-lotus-miner-entrypoint.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/docker-lotus-miner-entrypoint.sh b/scripts/docker-lotus-miner-entrypoint.sh index 8cdbaecceff..a8f2a554016 100755 --- a/scripts/docker-lotus-miner-entrypoint.sh +++ b/scripts/docker-lotus-miner-entrypoint.sh @@ -1,19 +1,24 @@ #!/usr/bin/env bash if [ ! -z $DOCKER_LOTUS_MINER_INIT ]; then - GATE="$LOTUS_PATH"/date_initialized + GATE="${LOTUS_MINER_PATH}/date_initialized" # Don't init if already initialized. - if [ -f "$GATE" ]; then + if [ ! -f "${GATE}" ]; then + echo starting init + eval "/usr/local/bin/lotus-miner init ${DOCKER_LOTUS_MINER_INIT_ARGS}" + if [ $? == 0 ] + then + echo lotus-miner init successful + date > "$GATE" + else + echo lotus-miner init unsuccessful + exit 1 + fi + else echo lotus-miner already initialized. - exit 0 fi - echo starting init - /usr/local/bin/lotus-miner init - - # Block future inits - date > "$GATE" fi exec /usr/local/bin/lotus-miner $@