raspiblitz/home.admin/98repairBlockchain.sh

49 lines
1.6 KiB
Bash
Raw Normal View History

2019-06-18 00:37:38 +02:00
#!/bin/bash
echo ""
2019-06-30 21:15:16 +02:00
# load raspiblitz config data
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
2019-06-18 00:37:38 +02:00
# Basic Options
OPTIONS=(TORRENT "Redownload Prepared Torrent (DEFAULT)" \
COPY "Copy from another Computer (SKILLED)" \
2019-06-30 21:15:16 +02:00
RESYNC "Resync thru Peer2Peer Network (TRUSTLESS)" \
2019-06-18 00:37:38 +02:00
BACKUP "Run Backup LND data first (optional)"
)
CHOICE=$(dialog --backtitle "RaspiBlitz - Repair Script" --clear --title "Repair Blockchain Data" --menu "Choose a repair/recovery option:" 11 60 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
clear
if [ "${CHOICE}" = "TORRENT" ]; then
echo "Starting TORRENT ..."
sudo sed -i "s/^state=.*/state=retorrent/g" /home/admin/raspiblitz.info
/home/admin/50torrentHDD.sh
2019-07-01 01:30:25 +02:00
sudo sed -i "s/^state=.*/state=na/g" /home/admin/raspiblitz.info
2019-06-18 00:37:38 +02:00
elif [ "${CHOICE}" = "COPY" ]; then
echo "Starting COPY ..."
sudo sed -i "s/^state=.*/state=recopy/g" /home/admin/raspiblitz.info
/home/admin/50copyHDD.sh
2019-07-01 01:30:25 +02:00
sudo sed -i "s/^state=.*/state=na/g" /home/admin/raspiblitz.info
2019-06-18 00:37:38 +02:00
2019-06-30 21:15:16 +02:00
elif [ "${CHOICE}" = "RESYNC" ]; then
echo "Starting RESYNC ..."
/home/admin/50syncHDD.sh
2019-07-01 02:26:01 +02:00
dialog --pause "OK. System will reboot to activate changes." 8 58 8
clear
echo "rebooting .. (please wait)"
2019-12-11 14:03:52 +01:00
sudo /home/admin/XXshutdown.sh reboot
2019-06-30 21:15:16 +02:00
2019-06-18 00:37:38 +02:00
elif [ "${CHOICE}" = "REINDEX" ]; then
echo "Starting REINDEX ..."
sudo /home/admin/config.scripts/network.reindex.sh
elif [ "${CHOICE}" = "BACKUP" ]; then
sudo /home/admin/config.scripts/lnd.rescue.sh backup
echo "PRESS ENTER to continue."
read key
else
echo "CANCEL"
fi