diff --git a/switch.sh b/switch.sh index d97c3e9..2899350 100755 --- a/switch.sh +++ b/switch.sh @@ -15,10 +15,11 @@ # Output: /statuses/node-status-bitcoind-ready (when ready, where a service can pick it up) RPCUSER="${RPCUSER:-umbrelrpc}" -RPCPASS="${RPCPASS:-$(cat /secrets/rpcpass.txt)}" # Default password location: /secrets/rpcpass.txt -SLEEPTIME="${SLEEPTIME:-3600}" # Default sleep: 3600 -JSONRPCURL="${JSONRPCURL:-http://10.254.2.2:8332}" # Default RPC endpoint: http://10.254.2.2:8332 -LND_CONTAINER_NAME="${LND_CONTAINER_NAME:-lnd}" # Default Docker container name: lnd +RPCPASS="${RPCPASS:-$(cat /secrets/rpcpass.txt)}" # Default password location: /secrets/rpcpass.txt +SLEEPTIME="${SLEEPTIME:-3600}" # Default sleep: 3600 +JSONRPCURL="${JSONRPCURL:-http://10.254.2.2:8332}" # Default RPC endpoint: http://10.254.2.2:8332 +LND_CONTAINER_NAME="${LND_CONTAINER_NAME:-lnd}" # Default Docker container name: lnd +BITCOIN_CONTAINER_NAME="${BITCOIN_CONTAINER_NAME:-bitcoin}" # Default Docker container name: bitcoin PREV_MATCH= @@ -80,7 +81,12 @@ switch_on_sync_done() { echo 'Bitcoind has been switched across to neutrino' touch /statuses/node-status-bitcoind-ready sed -Ei 's|(bitcoin.node)=neutrino|\1=bitcoind|g' /lnd/lnd.conf - + sed -i "s/dbcache=.*/dbcache=200/g;" /bitcoin/bitcoin.conf + + echo "Restarting Bitcoin" + docker stop "$BITCOIN_CONTAINER_NAME" + docker start "$BITCOIN_CONTAINER_NAME" + echo "Restarting LND" docker stop "$LND_CONTAINER_NAME" docker start "$LND_CONTAINER_NAME"