From 31a9a3b363acf2f393519c93b0c131045ffc2a13 Mon Sep 17 00:00:00 2001 From: Simon Kirillov Date: Sat, 19 Mar 2022 16:26:52 +0300 Subject: [PATCH] Fix docker entrypoint --- DOCKER/docker-entrypoint.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/DOCKER/docker-entrypoint.sh b/DOCKER/docker-entrypoint.sh index e6442b485..6d6e5748a 100755 --- a/DOCKER/docker-entrypoint.sh +++ b/DOCKER/docker-entrypoint.sh @@ -1,9 +1,16 @@ #!/bin/bash set -e +IS_INIT_CMD= + if [ ! -d "$TMHOME/config" ]; then - echo "Running tendermint init to create (default) configuration for docker run." - tendermint init validator + if [ "$1" == "init" ]; then + tendermint "$@" + IS_INIT_CMD=1 + else + echo "Running tendermint init to create (default) configuration for docker run." + tendermint init validator + fi sed -i \ -e "s/^proxy-app\s*=.*/proxy-app = \"$PROXY_APP\"/" \ @@ -18,6 +25,10 @@ if [ ! -d "$TMHOME/config" ]; then jq ".chain_id = \"$CHAIN_ID\" | .consensus_params.block.time_iota_ms = \"500\"" \ "$TMHOME/config/genesis.json" > "$TMHOME/config/genesis.json.new" mv "$TMHOME/config/genesis.json.new" "$TMHOME/config/genesis.json" + + if [ ! -z IS_INIT_CMD ]; then + exit + fi fi exec tendermint "$@"