Merge pull request #7709 from filecoin-project/logic-error-miner-entrypoint

fix logic error
This commit is contained in:
Jiaying Wang 2021-11-29 18:16:58 -05:00 committed by GitHub
commit 01215b7d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 $@