Browse Source

update bitcoin app exports.sh

main
nmfretz 2 years ago
parent
commit
92f305528e
  1. 12
      bitcoin/exports.sh

12
bitcoin/exports.sh

@ -128,11 +128,15 @@ fi
{ {
# Migrate settings for app updates differently to fresh installs # Migrate settings for app updates differently to fresh installs
BITCOIN_INSTALL_EXISTS="false"
BITCOIN_DATA_DIR="${EXPORTS_APP_DIR}/data/bitcoin" BITCOIN_DATA_DIR="${EXPORTS_APP_DIR}/data/bitcoin"
if [[ -d "${BITCOIN_DATA_DIR}/blocks" ]] || [[ -d "${BITCOIN_DATA_DIR}/testnet3/blocks" ]] || [[ -d "${BITCOIN_DATA_DIR}/regtest/blocks" ]] IS_POST_ADVANCED_SETTINGS_INSTALL_FILE_PATH="${EXPORTS_APP_DIR}/data/app/IS_POST_ADVANCED_SETTINGS_INSTALL"
# If no blocks directory exists, we write out a file to indicate that this is a fresh install.
# This gets around the issue of the pre-start hook starting up the bitcoind container early for Tor HS creation
# and creating the blocks directory.
if [[ ! -d "${BITCOIN_DATA_DIR}/blocks" ]] && [[ ! -d "${BITCOIN_DATA_DIR}/testnet3/blocks" ]] && [[ ! -d "${BITCOIN_DATA_DIR}/regtest/blocks" ]]
then then
BITCOIN_INSTALL_EXISTS="true" touch "${IS_POST_ADVANCED_SETTINGS_INSTALL_FILE_PATH}"
fi fi
APP_CONFIG_EXISTS="false" APP_CONFIG_EXISTS="false"
@ -141,7 +145,7 @@ fi
APP_CONFIG_EXISTS="true" APP_CONFIG_EXISTS="true"
fi fi
if [[ "${BITCOIN_INSTALL_EXISTS}" = "true" ]] && [[ "${APP_CONFIG_EXISTS}" = "false" ]] if [[ ! -f "${IS_POST_ADVANCED_SETTINGS_INSTALL_FILE_PATH}" ]] && [[ "${APP_CONFIG_EXISTS}" = "false" ]]
then then
# This app is not a fresh install, it's being updated, so preserve existing clearnet over Tor setting # This app is not a fresh install, it's being updated, so preserve existing clearnet over Tor setting
export BITCOIN_INITIALIZE_WITH_CLEARNET_OVER_TOR="true" export BITCOIN_INITIALIZE_WITH_CLEARNET_OVER_TOR="true"

Loading…
Cancel
Save