From 4369c8ec01ef9809af24427131fa1b01da50a698 Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Sun, 17 Mar 2019 16:29:59 +0100 Subject: [PATCH] make sure bitcoin is stpooed --- home.admin/00mainMenu.sh | 12 ++++++++++++ home.admin/50torrentHDD.sh | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 59b79e234..0e02fde66 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -65,6 +65,15 @@ if [ "${state}" = "reindex" ]; then exit 1 fi +# singal that torrent is in re-download +if [ "${state}" = "retorrent" ]; then + echo "Re-Index in progress ... start monitoring:" + /home/admin/50torrentHDD.sh + sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info + /home/admin/00mainMenu.sh + exit +fi + # if pre-sync is running - stop it - before continue if [ "${state}" = "presync" ]; then # stopping the pre-sync @@ -157,6 +166,7 @@ waitUntilChainNetworkIsReady() reindex=$(sudo cat /mnt/hdd/${network}/debug.log | grep -c 'Please restart with -reindex or -reindex-chainstate to recover') if [ ${reindex} -gt 0 ] || [ "${clienterror}" = "missing blockchain" ]; then echo "!! DETECTED NEED FOR RE-INDEX in debug.log ... starting repair options." + sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info sleep 3 dialog --backtitle "RaspiBlitz - Repair Script" --msgbox "Your blockchain data needs to be repaired. @@ -184,6 +194,7 @@ To run a BACKUP of funds & channels first is recommended. echo "Starting TORRENT ..." sudo sed -i "s/^state=.*/state=retorrent/g" /home/admin/raspiblitz.info /home/admin/50torrentHDD.sh + sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info /home/admin/00mainMenu.sh exit @@ -191,6 +202,7 @@ To run a BACKUP of funds & channels first is recommended. echo "Starting COPY ..." sudo sed -i "s/^state=.*/state=recopy/g" /home/admin/raspiblitz.info /home/admin/50copyHDD.sh + sudo sed -i "s/^state=.*/state=repair/g" /home/admin/raspiblitz.info /home/admin/00mainMenu.sh exit diff --git a/home.admin/50torrentHDD.sh b/home.admin/50torrentHDD.sh index c5631ba01..63d7c1e81 100755 --- a/home.admin/50torrentHDD.sh +++ b/home.admin/50torrentHDD.sh @@ -7,6 +7,15 @@ echo "" ## get basic info source /home/admin/raspiblitz.info + +# if setup was done - remove old data +if [ "${setupStep}" = "100" ]; then + echo "stopping servcies ..." + sudo systemctl stop lnd + sudo systemctl stop ${network}d + sudo systemctl disable ${network}d +fi + # make sure rtorrent is available sudo apt-get install rtorrent -y echo ""