Browse Source

switch cleanup and remove lockfiles

stateless
Luke Childs 4 years ago
parent
commit
4662547083
  1. 18
      switch.sh

18
switch.sh

@ -22,17 +22,10 @@ LND_CONTAINER_NAME="${LND_CONTAINER_NAME:-lnd}" # Default Docker container na
PREV_MATCH= PREV_MATCH=
switch_on_sync_done() { disable_neutrino_if_synced() {
# Node not pruned so lets do the switching echo 'Checking if LND is backed by Neutrino...'
echo 'Checking if synced...'
if [ -f /statuses/node-status-bitcoind-ready ]; then
echo 'LND is already switched to bitcoind!'
return 1
fi
if ! grep -q 'bitcoin.node=neutrino' /lnd/lnd.conf; then if ! grep -q 'bitcoin.node=neutrino' /lnd/lnd.conf; then
echo 'Neutrino mode has been disabled' echo 'Neutrino mode has been disabled'
echo 'Switchback is not supported in this version'
return 1 return 1
fi fi
@ -87,11 +80,6 @@ switch_on_sync_done() {
} }
while true; do while true; do
if ! switch_on_sync_done; then disable_neutrino_if_synced
echo 'Checking not necessary. Exiting.'
break
fi
# Run every every 1 hour by default or as per configurable
sleep "$SLEEPTIME" sleep "$SLEEPTIME"
done done

Loading…
Cancel
Save