lotus/scripts/docker-lotus-miner-entrypoint.sh

25 lines
505 B
Bash
Raw Permalink Normal View History

2021-06-21 19:48:07 +00:00
#!/usr/bin/env bash
if [ ! -z $DOCKER_LOTUS_MINER_INIT ]; then
2021-11-29 21:52:06 +00:00
GATE="${LOTUS_MINER_PATH}/date_initialized"
2021-06-21 19:48:07 +00:00
# Don't init if already initialized.
2021-11-29 21:52:06 +00:00
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
2021-06-21 19:48:07 +00:00
echo lotus-miner already initialized.
fi
fi
exec /usr/local/bin/lotus-miner $@