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-02 23:49:04 +01:00
|
|
|
source /home/admin/raspiblitz.info
|
2018-12-12 18:21:01 +01:00
|
|
|
source /mnt/hdd/raspiblitz.conf
|
2018-07-29 01:33:54 +02:00
|
|
|
|
2019-01-14 18:34:21 +01:00
|
|
|
# show password info dialog
|
2021-04-05 13:14:56 +02:00
|
|
|
resetAlsoPasswordB=$(sudo cat /mnt/hdd/bitcoin/bitcoin.conf | grep -c "rpcpassword=passwordB")
|
|
|
|
if [ ${resetAlsoPasswordB} -eq 0 ]; then
|
|
|
|
# just password A
|
|
|
|
dialog --backtitle "RaspiBlitz - Recover Setup" --msgbox "Your previous RaspiBlitz config was recovered.
|
2018-07-17 13:12:03 +02:00
|
|
|
|
2018-12-12 18:21:01 +01:00
|
|
|
You need to set a new Password A:
|
2018-07-17 13:12:03 +02:00
|
|
|
A) Master User Password
|
|
|
|
|
2021-04-05 13:14:56 +02:00
|
|
|
Passwords B & C stay as before.
|
2018-12-12 18:21:01 +01:00
|
|
|
|
|
|
|
Follow Password Rules: Minimal of 8 chars,
|
2018-11-27 21:11:53 +01:00
|
|
|
no spaces and only special characters - or .
|
2018-07-17 13:12:03 +02:00
|
|
|
Write them down & store them in a safe place.
|
2018-12-12 18:21:01 +01:00
|
|
|
" 14 52
|
2018-07-17 13:12:03 +02:00
|
|
|
|
2021-04-05 13:14:56 +02:00
|
|
|
# call set password a script
|
|
|
|
sudo /home/admin/config.scripts/blitz.setpassword.sh a
|
|
|
|
|
|
|
|
else
|
|
|
|
# password A + B
|
|
|
|
dialog --backtitle "RaspiBlitz - Recover Setup" --msgbox "Your previous RaspiBlitz config was recovered.
|
|
|
|
|
|
|
|
You need to set a new Password A & B:
|
|
|
|
A) Main User Password (SSH, WebUI, ..)
|
|
|
|
B) RPC & APP Password (Additional Apps, ..)
|
|
|
|
|
|
|
|
Passwords C (for your Lightning wallet) stays to the password you set before.
|
|
|
|
|
|
|
|
Follow Password Rules: Minimal of 8 chars,
|
|
|
|
no spaces and only special characters - or .
|
|
|
|
Write them down & store them in a safe place.
|
|
|
|
" 17 52
|
|
|
|
|
|
|
|
# call set password a script
|
|
|
|
sudo /home/admin/config.scripts/blitz.setpassword.sh a
|
|
|
|
sudo /home/admin/config.scripts/blitz.setpassword.sh b
|
|
|
|
|
|
|
|
fi
|
2018-07-17 13:12:03 +02:00
|
|
|
|
2019-01-14 18:34:21 +01:00
|
|
|
# sucess info dialog
|
|
|
|
dialog --backtitle "RaspiBlitz" --msgbox "OK - password A was set\nfor all users pi, admin, root & bitcoin" 6 52
|
2018-11-28 12:42:52 +01:00
|
|
|
|
2019-01-14 18:34:21 +01:00
|
|
|
# activate lnd & bitcoin service
|
|
|
|
echo "Enabling Services"
|
|
|
|
sudo systemctl daemon-reload
|
|
|
|
sudo systemctl enable lnd.service
|
|
|
|
sudo systemctl enable ${network}d.service
|
|
|
|
if [ "${rtlWebinterface}" = "on" ]; then
|
|
|
|
sudo systemctl enable RTL
|
|
|
|
fi
|
2019-12-18 12:26:49 +00:00
|
|
|
if [ "${loop}" = "on" ]; then
|
|
|
|
sudo systemctl enable loopd
|
|
|
|
fi
|
|
|
|
if [ "${BTCRPCexplorer}" = "on" ]; then
|
|
|
|
sudo systemctl enable btc-rpc-explorer
|
|
|
|
fi
|
|
|
|
if [ "${ElectRS}" = "on" ]; then
|
|
|
|
sudo systemctl enable electrs
|
|
|
|
fi
|
2018-11-28 14:13:17 +01:00
|
|
|
|
2019-01-14 18:34:21 +01:00
|
|
|
# remove flag that freshly recovered
|
|
|
|
sudo rm /home/admin/raspiblitz.recover.info
|
2018-11-28 14:17:21 +01:00
|
|
|
|
2019-01-14 18:34:21 +01:00
|
|
|
# when auto-unlock is activated then Password C is needed to be restored on SD card
|
|
|
|
if [ "${autoUnlock}" = "on" ]; then
|
2018-12-12 18:21:01 +01:00
|
|
|
|
2019-01-14 18:34:21 +01:00
|
|
|
# reset auto-unlock feature
|
|
|
|
dialog --backtitle "RaspiBlitz - Setup" --msgbox "You had the Auto-Unlock feature enabled.
|
2018-12-24 02:51:11 +01:00
|
|
|
|
|
|
|
In the next dialog you need to re-enter your
|
|
|
|
ACTUAL/OLD Password C to re-activate the
|
|
|
|
Auto-Unlock feature. Enter a empty password
|
|
|
|
to deactivate the Auto-Unlock feature.
|
|
|
|
" 10 52
|
2019-04-17 03:23:46 +01:00
|
|
|
echo "Activating Auto-Unlock (please wait) .."
|
2019-01-14 18:34:21 +01:00
|
|
|
sudo /home/admin/config.scripts/lnd.autounlock.sh on
|
2020-07-23 12:51:27 +02:00
|
|
|
dialog --backtitle "RaspiBlitz" --pause " FINAL REBOOT IS NEEDED." 8 52 5
|
2018-07-29 01:33:54 +02:00
|
|
|
|
2019-01-14 18:34:21 +01:00
|
|
|
else
|
2021-04-05 13:14:56 +02:00
|
|
|
dialog --backtitle "RaspiBlitz" --pause " OK - Passwords set.\n FINAL REBOOT IS NEEDED." 9 52 5
|
2019-01-14 18:34:21 +01:00
|
|
|
fi
|
2018-11-28 14:13:17 +01:00
|
|
|
|
2019-12-11 14:03:52 +01:00
|
|
|
sudo /home/admin/XXshutdown.sh reboot
|