Browse Source

Merge branch 'master' into addNicerCliScript

#146
Constantin 7 years ago
parent
commit
b6b4b29b19
  1. 10
      README.md
  2. 2
      home.admin/00infoLCD.sh
  3. 8
      home.admin/00mainMenu.sh
  4. 8
      home.admin/20initDialog.sh
  5. 60
      home.admin/50downloadHDD.sh
  6. 2
      home.admin/70initLND.sh
  7. 2
      home.admin/90finishSetup.sh

10
README.md

@ -53,15 +53,13 @@ If you organizing an educational event where you want to support people learning
*There are two ways to start:* *There are two ways to start:*
### Scenario 1: “At a Hackathon/Event” ### Scenario 1: “At a Hackathon/Event”
If you are at an event, ask for a ready-2-go set or if you have your own hardware ask for assistance to prepare your SD-Card and HDD. Then you are all set and and you can proceed with "SetUp your RaspiBlitz". If you are at an event, ask for a ready-2-go set or if you have your own hardware ask for assistance to prepare your SD-Card and HDD. Then you are all set and and you can proceed with "Setup your RaspiBlitz".
### Scenario 2 “Start at Home” ### Scenario 2 “Start at Home”
You got all the hardware of the shopping list above and you have no further assistance. Then you need to prepare your SD-Card yourself .. this scenario is still experimental, feedback needed and can take some time. You got all the hardware of the shopping list above and you have no further assistance. Then you need to prepare your SD-Card yourself .. this scenario is still experimental, feedback needed and can take some time.
1. Download SD-Card image with [bittorrent](https://www.utorrent.com/intl/en/downloads/): 1. Download SD-Card image:
https://wiki.fulmo.org/downloads/raspiblitz-2018-07-17b.torrent http://wiki.fulmo.org/downloads/raspiblitz-2018-07-25.img.gz
or try this HTTP-Link for direct download:
http://wiki.fulmo.org/downloads/raspiblitz-2018-07-17b.img.gz
2. Write the SD-Card image to your SD Card - if you need details, see here: 2. Write the SD-Card image to your SD Card - if you need details, see here:
https://www.raspberrypi.org/documentation/installation/installing-images/README.md https://www.raspberrypi.org/documentation/installation/installing-images/README.md
@ -221,7 +219,7 @@ Already integrated features of the RaspiBlitz are/willbe listed as part of the m
## Educational Tutorials ## Educational Tutorials
*Once the SetUp Process is done, the learning and building should begin ... more detailed educational content should be added in this section in the future.* *Once the Setup Process is done, the learning and building should begin ... more detailed educational content should be added in this section in the future.*
A good way to start for now is to get some Testnet coins, connect to other peers and make your first transactions. You find tutorials for this at the original RaspiBolt guide: https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_40_lnd.md#get-some-testnet-bitcoin A good way to start for now is to get some Testnet coins, connect to other peers and make your first transactions. You find tutorials for this at the original RaspiBolt guide: https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_40_lnd.md#get-some-testnet-bitcoin

2
home.admin/00infoLCD.sh

@ -60,7 +60,7 @@ if [ "$USER" = "pi" ]; then
l1="Login to your RaspiBlitz with:\n" l1="Login to your RaspiBlitz with:\n"
l2="ssh admin@${localip}\n" l2="ssh admin@${localip}\n"
l3="Use your Password A\n" l3="Use your Password A\n"
dialog --backtitle "RaspiBlitz - SetUp Mode" --infobox "$l1$l2$l3" 5 34 dialog --backtitle "RaspiBlitz - Setup Mode" --infobox "$l1$l2$l3" 5 34
sleep 10 sleep 10
fi fi

8
home.admin/00mainMenu.sh

@ -18,19 +18,19 @@ fi
if [ ${setupState} -eq 0 ]; then if [ ${setupState} -eq 0 ]; then
# start setup # start setup
BACKTITLE="RaspiBlitz - SetUp" BACKTITLE="RaspiBlitz - Setup"
TITLE="⚡ Welcome to your RaspiBlitz ⚡" TITLE="⚡ Welcome to your RaspiBlitz ⚡"
MENU="\nYou need to setup and init Bitcoin and Lightning services: \n " MENU="\nYou need to setup and init Bitcoin and Lightning services: \n "
OPTIONS+=(1 "Start the SetUp of your RaspiBlitz") OPTIONS+=(1 "Start the Setup of your RaspiBlitz")
HEIGHT=10 HEIGHT=10
elif [ ${setupState} -lt 100 ]; then elif [ ${setupState} -lt 100 ]; then
# continue setup # continue setup
BACKTITLE="RaspiBlitz - SetUp" BACKTITLE="RaspiBlitz - Setup"
TITLE="⚡ Welcome to your RaspiBlitz ⚡" TITLE="⚡ Welcome to your RaspiBlitz ⚡"
MENU="\nContinue setup and init of Bitcoin and Lightning services: \n " MENU="\nContinue setup and init of Bitcoin and Lightning services: \n "
OPTIONS+=(1 "Continue SetUp of your RaspiBlitz") OPTIONS+=(1 "Continue Setup of your RaspiBlitz")
HEIGHT=10 HEIGHT=10
else else

8
home.admin/20initDialog.sh

@ -7,7 +7,7 @@ while [ ${#result} -eq 0 ]
do do
l1="Please enter the name of your new RaspiBlitz:\n" l1="Please enter the name of your new RaspiBlitz:\n"
l2="one word, keep characters basic & not too long" l2="one word, keep characters basic & not too long"
dialog --backtitle "RaspiBlitz - SetUp" --inputbox "$l1$l2" 11 52 2>$_temp dialog --backtitle "RaspiBlitz - Setup" --inputbox "$l1$l2" 11 52 2>$_temp
result=`cat $_temp` result=`cat $_temp`
shred $_temp shred $_temp
done done
@ -20,7 +20,7 @@ sed -i "7s/.*/alias=$result/" ./assests/lnd.conf
echo $result >> /home/admin/.hostname echo $result >> /home/admin/.hostname
# show password info dialog # show password info dialog
dialog --backtitle "RaspiBlitz - SetUp" --msgbox "RaspiBlitz uses 4 different passwords. dialog --backtitle "RaspiBlitz - Setup" --msgbox "RaspiBlitz uses 4 different passwords.
Referenced as password A, B, C and D. Referenced as password A, B, C and D.
A) Master User Password A) Master User Password
@ -33,7 +33,7 @@ Write them down & store them in a safe place.
" 14 52 " 14 52
# ask user for new password A # ask user for new password A
dialog --backtitle "RaspiBlitz - SetUp"\ dialog --backtitle "RaspiBlitz - Setup"\
--inputbox "Please enter your Master/Admin Password A:\n!!! This is new password to login per SSH !!!" 10 52 2>$_temp --inputbox "Please enter your Master/Admin Password A:\n!!! This is new password to login per SSH !!!" 10 52 2>$_temp
# get user input # get user input
@ -62,7 +62,7 @@ dialog --backtitle "RaspiBlitz" --msgbox "OK - password changed to '$result'\nfo
result="" result=""
while [ ${#result} -lt 8 ] while [ ${#result} -lt 8 ]
do do
dialog --backtitle "RaspiBlitz - SetUp"\ dialog --backtitle "RaspiBlitz - Setup"\
--inputbox "Enter your RPC Password B (min 8 chars):" 9 52 2>$_temp --inputbox "Enter your RPC Password B (min 8 chars):" 9 52 2>$_temp
result=`cat $_temp` result=`cat $_temp`
shred $_temp shred $_temp

60
home.admin/50downloadHDD.sh

@ -2,6 +2,8 @@
# name of torrentfile = name of directory in torrent # name of torrentfile = name of directory in torrent
torrent="raspiblitz-hdd-2018-07-16" torrent="raspiblitz-hdd-2018-07-16"
# size of a valid download (run on seed directory 'du -s ./[TORRENTDIRECTORY]')
torrentsize=462470200
echo "" echo ""
echo "*** Checking HDD ***" echo "*** Checking HDD ***"
@ -15,16 +17,60 @@ if [ ${mountOK} -eq 1 ]; then
# HDD is empty - download HDD content # HDD is empty - download HDD content
echo "OK - HDD is ready." echo "OK - HDD is ready."
echo "" echo ""
echo "*** Downloading HDD ***"
tmpfile=$(mktemp) downloading=1
chmod a+x $tmpfile retry=0
echo "killall transmission-cli" > $tmpfile while [ $downloading -eq 1 ]
sudo transmission-cli ./assets/$torrent.torrent -D -w /mnt/hdd -f $tmpfile do
echo "*** Downloading HDD ***"
tmpfile=$(mktemp)
chmod a+x $tmpfile
echo "killall transmission-cli" > $tmpfile
sudo transmission-cli ./assets/$torrent.torrent -D -et -w /mnt/hdd -f $tmpfile
echo ""
echo "*** Checking Download ***"
echo "wait a moment"
sleep 5
downloadsize=$(sudo du -s /mnt/hdd/$torrent/ | awk '{print $1}' | tr -dc '0-9')
if [ ${#downloadsize} -eq 0 ]; then
downloadsize=0
fi
# add some tolerance for checking
torrentsize="$(($torrentsize-1024000))"
echo "download size is(${downloadsize})"
if [ ${downloadsize} -lt ${torrentsize} ]; then
echo ""
echo "FAIL - download is not ${torrentsize}"
retry=$(($retry+1))
if [ ${retry} -gt 2 ]; then
echo "All Retry FAILED"
downloading=0
else
echo "--> RETRY(${retry}) in 10 secs"
sleep 10
echo ""
fi
else
echo "OK - Download is complete"
downloading=0
fi
done
if [ ${downloadsize} -lt ${torrentsize} ]; then
sleep 3
dialog --title " WARNING " --yesno "The download failed or is not complete. Do you want to clean all download data before you continue?" 6 57
response=$?
case $response in
0) sudo rm -rf /mnt/hdd/$torrent ; sudo rm -rf /root/.config/transmission ;;
esac
#
./00mainMenu.sh
exit 1;
fi
echo "" echo ""
echo "*** Moving Files ***" echo "*** Moving Files ***"
echo "moving files ..." echo "moving files ..."
mv /mnt/hdd/$torrent/* /mnt/hdd sudo mv /mnt/hdd/$torrent /mnt/hdd/bitcoin
rm -R /mnt/hdd/$torrent
echo "" echo ""
# set SetupState # set SetupState

2
home.admin/70initLND.sh

@ -175,5 +175,5 @@ fi
# set SetupState (scan is done - so its 80%) # set SetupState (scan is done - so its 80%)
echo "80" > /home/admin/.setup echo "80" > /home/admin/.setup
###### finishSetUp ###### finishSetup
./90finishSetup.sh ./90finishSetup.sh

2
home.admin/90finishSetup.sh

@ -38,7 +38,7 @@ echo "Setting new network hostname '$hostname'"
sudo hostnamectl set-hostname ${hostname} sudo hostnamectl set-hostname ${hostname}
# show info to user # show info to user
dialog --backtitle "RaspiBlitz - SetUp" --title " RaspiBlitz Setup is done :) " --msgbox " dialog --backtitle "RaspiBlitz - Setup" --title " RaspiBlitz Setup is done :) " --msgbox "
Press OK for a final reboot. Press OK for a final reboot.
Remember: After every reboot Remember: After every reboot

Loading…
Cancel
Save