-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cory Schwartz
committed
Nov 29, 2021
1 parent
6c0374c
commit 27efbc3
Showing
1 changed file
with
13 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $@ |