mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 12:06:36 +02:00
protect old data from deletion
This commit is contained in:
@@ -16,7 +16,7 @@ lightning=""
|
|||||||
# chose blockchain
|
# chose blockchain
|
||||||
OPTIONS=()
|
OPTIONS=()
|
||||||
OPTIONS+=(BITCOIN "Setup BITCOIN Blockchain (BitcoinCore)")
|
OPTIONS+=(BITCOIN "Setup BITCOIN Blockchain (BitcoinCore)")
|
||||||
OPTIONS+=(LITECOIN "Setup LITECOIN Blockchain")
|
OPTIONS+=(LITECOIN "Setup LITECOIN Blockchain (experimental)")
|
||||||
CHOICE=$(dialog --clear \
|
CHOICE=$(dialog --clear \
|
||||||
--backtitle "RaspiBlitz ${codeVersion} - Setup" \
|
--backtitle "RaspiBlitz ${codeVersion} - Setup" \
|
||||||
--title "⚡ Blockchain ⚡" \
|
--title "⚡ Blockchain ⚡" \
|
||||||
|
14
home.admin/setup.scripts/dialogDeleteData.sh
Normal file
14
home.admin/setup.scripts/dialogDeleteData.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
whiptail --title " FORMATTING DATA DRVE " --yes-button "DELETE DATA" --no-button "CANCEL" --yesno "For fresh setup your data drive needs to be formatted, but there is old data on your HDD/SSD that could contain funds.
|
||||||
|
|
||||||
|
Are you really sure that you want delete that old data?
|
||||||
|
" 10 65
|
||||||
|
|
||||||
|
if [ "$?" == "0" ]; then
|
||||||
|
# 0 --> delete data
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
# 1 --> cancel
|
||||||
|
exit 1
|
||||||
|
fi
|
@@ -8,6 +8,9 @@ source /home/admin/raspiblitz.info
|
|||||||
# this key/value file contains the state during the setup process
|
# this key/value file contains the state during the setup process
|
||||||
SETUPFILE="/var/cache/raspiblitz/temp/raspiblitz.setup"
|
SETUPFILE="/var/cache/raspiblitz/temp/raspiblitz.setup"
|
||||||
|
|
||||||
|
# remember original setupphase
|
||||||
|
orgSetupPhase="${setupPhase}"
|
||||||
|
|
||||||
# init SETUPFILE & temp dir on mem drive
|
# init SETUPFILE & temp dir on mem drive
|
||||||
sudo mkdir /var/cache/raspiblitz/temp
|
sudo mkdir /var/cache/raspiblitz/temp
|
||||||
sudo chown admin:admin /var/cache/raspiblitz/temp
|
sudo chown admin:admin /var/cache/raspiblitz/temp
|
||||||
@@ -106,6 +109,15 @@ if [ "${setupPhase}" == "setup" ]; then
|
|||||||
# FRESH SETUP
|
# FRESH SETUP
|
||||||
if [ "${menuresult}" == "0" ]; then
|
if [ "${menuresult}" == "0" ]; then
|
||||||
|
|
||||||
|
# if other data is on HDD/SSD from migration/recover warn on formatting drive
|
||||||
|
if [ "${orgSetupPhase}" != "${setupPhase}" ]; then
|
||||||
|
/home/admin/setup.scripts/dialogDeleteData.sh
|
||||||
|
if [ "$?" == "1" ]; then
|
||||||
|
# exit with 0 to restart process from outside loop
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# Choosing Blockchain & Lightning
|
# Choosing Blockchain & Lightning
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user