[Bitcoin] Add CREATE_WALLET to control if the container need to create wallet by default

This commit is contained in:
nicolas.dorier 2022-12-12 16:17:08 +09:00
parent c23a68d65f
commit e35bea7557
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -25,7 +25,8 @@ if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1
mkdir -p "$WALLETDIR"
chown -R bitcoin:bitcoin "$WALLETDIR"
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
if ! [[ -f "${WALLETFILE}" ]]; then
: "${CREATE_WALLET:=true}"
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
fi