Skip to content

Commit

Permalink
fix logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cory Schwartz committed Nov 29, 2021
1 parent 6c0374c commit 27efbc3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scripts/docker-lotus-miner-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 $@

0 comments on commit 27efbc3

Please sign in to comment.