2018-12-05 00:07:58 +01:00
#!/bin/bash
2021-03-16 20:43:34 +00:00
_temp = $( mktemp -p /dev/shm/)
2018-07-17 13:12:03 +02:00
2018-12-06 14:36:02 +01:00
## get basic info
source /home/admin/raspiblitz.info 2>/dev/null
2018-07-29 01:33:54 +02:00
2020-01-20 19:29:22 +01:00
###################
# CHECK IF DNS NEEDS SETTING DURING SETUP
# https://github.com/rootzoll/raspiblitz/issues/787
###################
sudo /home/admin/config.scripts/internet.dns.sh test
2019-01-14 18:34:21 +01:00
###################
# ENTER NAME
###################
2019-02-09 18:36:34 +01:00
# welcome and ask for name of RaspiBlitz
2018-07-17 13:12:03 +02:00
result = ""
while [ ${# result } -eq 0 ]
do
l1 = "Please enter the name of your new RaspiBlitz:\n"
l2 = "one word, keep characters basic & not too long"
2018-12-10 14:55:15 +01:00
dialog --backtitle " RaspiBlitz - Setup ( ${ network } / ${ chain } ) " --inputbox " $l1 $l2 " 11 52 2>$_temp
2018-11-28 14:07:33 +01:00
result = $( cat $_temp | tr -dc '[:alnum:]-.' | tr -d ' ' )
2020-05-02 11:32:04 +02:00
shred -u $_temp
2019-02-09 18:34:13 +01:00
echo "processing ..."
sleep 3
2018-07-17 13:12:03 +02:00
done
# set lightning alias
2018-08-14 12:48:01 +02:00
sed -i " s/^alias=.*/alias= ${ result } /g " /home/admin/assets/lnd.${ network } .conf
2018-07-17 13:12:03 +02:00
# store hostname for later - to be set right before the next reboot
# work around - because without a reboot the hostname seems not updates in the whole system
2018-12-06 14:36:02 +01:00
valueExistsInInfoFile = $( sudo cat /home/admin/raspiblitz.info | grep -c "hostname=" )
if [ ${ valueExistsInInfoFile } -eq 0 ] ; then
# add
echo " hostname= ${ result } " >> /home/admin/raspiblitz.info
2018-12-11 01:36:23 +01:00
else
# update
sed -i " s/^hostname=.*/hostname= ${ result } /g " /home/admin/raspiblitz.info
2018-12-06 14:36:02 +01:00
fi
2019-01-14 18:34:21 +01:00
###################
# ENTER PASSWORDS
###################
2018-07-17 13:12:03 +02:00
2019-01-14 18:34:21 +01:00
# show password info dialog
dialog --backtitle " RaspiBlitz - Setup ( ${ network } / ${ chain } ) " --msgbox " RaspiBlitz uses 4 different passwords.
2018-07-17 13:12:03 +02:00
Referenced as password A, B, C and D.
A) Master User Password
2018-07-29 01:33:54 +02:00
B) Blockchain RPC Password
2018-07-17 13:12:03 +02:00
C) LND Wallet Password
D) LND Seed Password
2018-11-27 21:11:53 +01:00
Choose now 4 new passwords - all min 8 chars,
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-11-28 12:42:52 +01:00
" 15 52
2018-07-17 13:12:03 +02:00
2019-01-14 18:34:21 +01:00
# call set password a script
sudo /home/admin/config.scripts/blitz.setpassword.sh a
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-07-29 01:33:54 +02:00
2019-01-14 18:34:21 +01:00
# call set password b script
sudo /home/admin/config.scripts/blitz.setpassword.sh b
2018-11-28 14:13:17 +01:00
2019-01-14 18:34:21 +01:00
# success info dialog
dialog --backtitle "RaspiBlitz" --msgbox "OK - RPC password changed \n\nNow starting the Setup of your RaspiBlitz." 7 52
2019-06-13 02:27:19 +02:00
###################
# TOR BY DEFAULT
# https://github.com/rootzoll/raspiblitz/issues/592
2021-03-15 23:16:27 +01:00
#
2019-06-13 02:27:19 +02:00
###################
2021-03-15 23:16:27 +01:00
echo "runBehindTor=on" >> /home/admin/raspiblitz.info
#whiptail --title ' Privacy Level - How do you want to run your node? ' --yes-button='Public IP' --no-button='TOR NETWORK' --yesno "Running your Lightning node with your Public IP is common and faster, but might reveal your personal identity and location.\n
#You can better protect your privacy with running your lightning node as a TOR Hidden Service from the start, but it can make it harder to connect with other non-TOR nodes and remote mobile apps later on.
# " 12 75
#if [ $? -eq 1 ]; then
# echo "runBehindTor=on" >> /home/admin/raspiblitz.info
#fi
2019-06-13 02:27:19 +02:00
2019-12-13 23:09:40 +01:00
# set SetupState
sudo sed -i "s/^setupStep=.*/setupStep=20/g" /home/admin/raspiblitz.info
2019-01-14 18:34:21 +01:00
clear