raspiblitz/home.admin/50syncHDD.sh

68 lines
1.9 KiB
Bash
Raw Normal View History

2018-12-05 00:07:58 +01:00
#!/bin/bash
2018-07-17 13:12:03 +02:00
2018-12-06 14:36:02 +01:00
## get basic info
2019-02-13 02:33:27 +01:00
source /home/admin/raspiblitz.info
2018-07-17 13:12:03 +02:00
2018-07-29 01:33:54 +02:00
# only show warning when bitcoin
if [ "$network" = "bitcoin" ]; then
# detect hardware version of RaspberryPi
# https://www.unixtutorial.org/command-to-confirm-raspberry-pi-model
raspberryPi=$(cat /proc/device-tree/model | cut -d " " -f 3 | sed 's/[^0-9]*//g')
if [ ${#raspberryPi} -eq 0 ]; then
raspberryPi=0
fi
echo "RaspberryPi Model Version: ${raspberryPi}"
if [ ${raspberryPi} -lt 4 ]; then
# raspberryPi 3 and lower
msg=" This old RaspberryPi has very limited CPU power.\n"
msg="$msg To sync & validate the complete blockchain\n"
msg="$msg can take multiple days - even weeksn"
msg="$msg Its recommended to use another option.\n"
msg="$msg \n"
msg="$msg So do you really want start syncing now?"
else
# raspberryPi 4 and up
msg=" Your RaspiBlitz will sync and validate\n"
msg="$msg the complete blockchain by itself.\n"
msg="$msg This can take multiple days, but\n"
msg="$msg its the best to do it this way.\n"
msg="$msg \n"
msg="$msg So do you want start syncing now?"
fi
2018-07-29 01:33:54 +02:00
dialog --title " WARNING " --yesno "${msg}" 11 57
2018-07-29 01:33:54 +02:00
response=$?
case $response in
0) echo "--> OK";;
1) ./10setupBlitz.sh; exit 1;;
255) ./10setupBlitz.sh; exit 1;;
esac
clear
if [ ${raspberryPi} -lt 4 ]; then
echo "********************************"
echo "This is madness. This is Sparta!"
echo "********************************"
echo ""
sleep 3
else
echo "**********************************"
echo "Dont Trust, verify - starting sync"
echo "**********************************"
echo ""
sleep 3
fi
2018-07-29 01:33:54 +02:00
fi
2018-07-17 13:12:03 +02:00
echo "*** Activating Blockain Sync ***"
2018-07-29 01:33:54 +02:00
sudo mkdir /mnt/hdd/${network}
2018-07-17 13:12:03 +02:00
echo "OK - sync is activated"
# set SetupState
2018-12-06 03:32:19 +01:00
sudo sed -i "s/^setupStep=.*/setupStep=50/g" /home/admin/raspiblitz.info
2018-07-17 13:12:03 +02:00
# continue setup
./60finishHDD.sh