Browse Source

Persist LND backend between OTA updates (#211)

restore-backups
Luke Childs 4 years ago
committed by GitHub
parent
commit
0c8a8eb8bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      scripts/configure

15
scripts/configure

@ -32,6 +32,13 @@ if [[ ! -d "$UMBREL_ROOT" ]]; then
fi
cd "$UMBREL_ROOT"
# Make sure we use the status dir from the real Umbrel installation if this is
# an OTA update.
STATUS_DIR="${UMBREL_ROOT}/statuses"
if [[ -f "${UMBREL_ROOT}/../.umbrel" ]]; then
STATUS_DIR="${UMBREL_ROOT}/../statuses"
fi
# Configure for mainnet or testnet or regtest depending
# upon the user-supplied value of $NETWORK
BITCOIN_NETWORK="${NETWORK:-mainnet}"
@ -43,7 +50,7 @@ fi
echo
echo "======================================"
if [[ -f "${UMBREL_ROOT}/statuses/configured" ]]; then
if [[ -f "${STATUS_DIR}/configured" ]]; then
echo "=========== RECONFIGURING ============"
else
echo "============ CONFIGURING ============="
@ -156,6 +163,10 @@ sed -i "s/tor.password=<password>/tor.password=$TOR_PASS/g;" "$LND_CONF_FILE"
sed -i "s/TOR_PASSWORD=<password>/TOR_PASSWORD=$TOR_PASS/g;" "$ENV_FILE"
sed -i "s/TOR_HASHED_PASSWORD=<password>/TOR_HASHED_PASSWORD=$TOR_HASHED_PASS/g;" "$ENV_FILE"
# If node is already synced, do not reset to neutrino
if [[ -f "${STATUS_DIR}/node-status-bitcoind-ready" ]]; then
sed -i "s/bitcoin.node=.*/bitcoin.node=bitcoind/g;" "$LND_CONF_FILE"
fi
##########################################################
############### Performance optimizations ################
@ -195,7 +206,7 @@ echo
chown -R 1000:1000 "$UMBREL_ROOT"
# Create configured status
touch "$UMBREL_ROOT"/statuses/configured
touch "${STATUS_DIR}/configured"
echo "Configuration successful"
echo "You can now start Umbrel by running:"

Loading…
Cancel
Save