updated copy script, added net-tools, added to readme

This commit is contained in:
openoms
2019-01-29 12:24:37 +00:00
parent 5364ce0dcf
commit ff32129e28
5 changed files with 63 additions and 25 deletions

View File

@@ -28,7 +28,7 @@ Reboots again
`ssh root@[IP-OF-DIETPI]` `ssh root@[IP-OF-DIETPI]`
Now only the bash prompt opens Now only the bash prompt opens
sudo apt install rsync sudo apt install -y rsync (now added to the script)
use: wget https://raw.githubusercontent.com/[GITHUB-USERNAME]/raspiblitz/[BRANCH]/build.sdcard/raspbianStretchDesktop.sh && sudo bash raspbianStretchDesktop.sh [BRANCH] [GITHUB-USERNAME] use: wget https://raw.githubusercontent.com/[GITHUB-USERNAME]/raspiblitz/[BRANCH]/build.sdcard/raspbianStretchDesktop.sh && sudo bash raspbianStretchDesktop.sh [BRANCH] [GITHUB-USERNAME]
@@ -38,7 +38,7 @@ password: raspiblitz
see my output: [sdcard_build_output](sdcard_build_output.html) see my output: [sdcard_build_output](sdcard_build_output.html)
The only fault appears to be with `fail2ban` The only fault appears to be with `fail2ban`
(this is solved if fail2ban is intalled from the DietPi software settings during the second boot)
`ssh admin@[IP-OF-DROIDBLITZ]` `ssh admin@[IP-OF-DROIDBLITZ]`
password: raspiblitz password: raspiblitz

View File

@@ -1,10 +1,15 @@
[ [Hardware](#hardware-needed-amazon-shopping-list) ] -- [ [Setup](#boot-your-raspiblitz) ] -- [ [Documentation](#documentation) ] -- [ [Development](#further-development-of-raspiblitz) ] [ [Hardware](#hardware-needed-amazon-shopping-list) ] -- [ [Setup](#boot-your-raspiblitz) ] -- [ [Documentation](#documentation) ] -- [ [Development](#further-development-of-raspiblitz) ]
----- -----
# DroidBlitz with DietPi
see: [/DietPi/install.md](/DietPi/install.md)
# RaspiBlitz # RaspiBlitz
Fastest and cheapest way to get your own Lightning Node running - on a RaspberryPi with a nice LCD. Fastest and cheapest way to get your own Lightning Node running - on a RaspberryPi with a nice LCD.
`Version 0.98 (1.0 RC1) with lnd 0.5.1 and bitcoin 0.17.0.1 & litecoin 0.16.3.` `Version 0.99 (1.0 RC1) with lnd 0.5.1 and bitcoin 0.17.0.1 & litecoin 0.16.3.`
![RaspiBlitz](pictures/raspiblitz.jpg) ![RaspiBlitz](pictures/raspiblitz.jpg)

View File

@@ -1,16 +1,14 @@
#!/bin/bash #!/bin/bash
######################################################################### #########################################################################
# Build your SD card image based on: # Build your SD card image based on:
# RASPBIAN STRETCH WITH DESKTOP (2018-11-13) # DietPi.com
# https://www.raspberrypi.org/downloads/raspbian/
# SHA256: a121652937ccde1c2583fe77d1caec407f2cd248327df2901e4716649ac9bc97
########################################################################## ##########################################################################
# setup fresh SD card with image above - login per SSH and run this script: # setup fresh SD card with image above - login per SSH and run this script:
########################################################################## ##########################################################################
echo "" echo ""
echo "*****************************************" echo "*****************************************"
echo "* RASPIBLITZ SD CARD IMAGE SETUP v0.99 *" echo "* DROIDLITZ SD CARD IMAGE SETUP v0.1 *"
echo "*****************************************" echo "*****************************************"
echo "" echo ""
@@ -94,12 +92,17 @@ if [ "${baseImage}" = "dietpi" ]; then
echo "*** PREPARE DietPi ***" echo "*** PREPARE DietPi ***"
echo "renaming dietpi user to pi" echo "renaming dietpi user to pi"
sudo usermod -l pi dietpi sudo usermod -l pi dietpi
# add pi to the sudo group
sudo adduser pi sudo sudo adduser pi sudo
echo "install pip" echo "install pip"
sudo apt-get update sudo apt-get update
sudo apt-get remove -y fail2ban sudo apt-get remove -y fail2ban
sudo apt-get install -y build-essential sudo apt-get install -y build-essential
sudo apt-get install -y python-pip sudo apt-get install -y python-pip
# rsync is needed to copy from HDD
sudo apt install -y rsync
# install ifconfig
sudo apt install -y net-tools
fi fi
# special prepare when Raspbian # special prepare when Raspbian
@@ -442,14 +445,16 @@ sudo -u admin cp -r /home/admin/raspiblitz/home.admin/config.scripts /home/admin
sudo -u admin chmod +x /home/admin/config.scripts/*.sh sudo -u admin chmod +x /home/admin/config.scripts/*.sh
# prifile path for admin # profile path for admin
sudo bash -c "echo '' >> /home/admin/.profile" sudo bash -c "echo '' >> /home/admin/.profile"
sudo bash -c "echo 'GOROOT=/usr/local/go' >> /home/admin/.profile" sudo bash -c "echo 'GOROOT=/usr/local/go' >> /home/admin/.profile"
sudo bash -c "echo 'PATH=\$PATH:\$GOROOT/bin' >> /home/admin/.profile" sudo bash -c "echo 'PATH=\$PATH:\$GOROOT/bin' >> /home/admin/.profile"
sudo bash -c "echo 'GOPATH=/usr/local/gocode' >> /home/admin/.profile" sudo bash -c "echo 'GOPATH=/usr/local/gocode' >> /home/admin/.profile"
sudo bash -c "echo 'PATH=\$PATH:\$GOPATH/bin' >> /home/admin/.profile" sudo bash -c "echo 'PATH=\$PATH:\$GOPATH/bin' >> /home/admin/.profile"
# add /sbin to path for admin
sudo bash -c "echo 'PATH=\$PATH:\$GOPATH/sbin' >> /home/admin/.profile"
# bash aoutstart for admin # bash autostart for admin
sudo bash -c "echo '# shortcut commands' >> /home/admin/.bashrc" sudo bash -c "echo '# shortcut commands' >> /home/admin/.bashrc"
sudo bash -c "echo 'source /home/admin/_commands.sh' >> /home/admin/.bashrc" sudo bash -c "echo 'source /home/admin/_commands.sh' >> /home/admin/.bashrc"
sudo bash -c "echo '# automatically start main menu for admin' >> /home/admin/.bashrc" sudo bash -c "echo '# automatically start main menu for admin' >> /home/admin/.bashrc"
@@ -537,7 +542,7 @@ echo "Press ENTER to install LCD and reboot ..."
read key read key
# give Raspi a default hostname (optional) # give Raspi a default hostname (optional)
sudo raspi-config nonint do_hostname "RaspiBlitz" sudo raspi-config nonint do_hostname "DroidBlitz"
# *** Display selection *** # *** Display selection ***
dialog --title "Display" --yesno "Are you using the default display available from Amazon?\nSelect 'No' if you are using the Swiss version from play-zone.ch!" 6 80 dialog --title "Display" --yesno "Are you using the default display available from Amazon?\nSelect 'No' if you are using the Swiss version from play-zone.ch!" 6 80

View File

@@ -12,7 +12,26 @@ if [ ${hddA} -eq 0 ]; then
echo "Try 'sudo shutdown -r now'" echo "Try 'sudo shutdown -r now'"
exit 1 exit 1
fi fi
echo "OK - HDD as sda1 found"
ready=0
while [ ${ready} -eq 0 ]
do
hddA=$(lsblk | grep /mnt/hdd | grep -c sda1)
if [ ${hddB} -eq 1 ]; then
echo "OK - HDD as sda1 found"
ready=1
if [ ${hddA} -eq 0 ]; then
echo "FAIL - 1st HDD not found as sda1 or sda"
echo "Try 'sudo shutdown -r now'"
exit 1
fi
hddB=$(lsblk | grep -c sda)
if [ ${hddB} -eq 1 ]; then
echo "OK - HDD as sda found"
ready=1
fi
done
echo "" echo ""
echo "*** Copy Blockchain form a second HDD ***" echo "*** Copy Blockchain form a second HDD ***"
echo "" echo ""
@@ -34,17 +53,14 @@ echo "then cancel (CTRL+c) and reboot."
ready=0 ready=0
while [ ${ready} -eq 0 ] while [ ${ready} -eq 0 ]
do do
hddA=$(lsblk | grep /mnt/hdd | grep -c sda1) hddC=$(lsblk | grep -c sdb1)
if [ ${hddA} -eq 0 ]; then
echo "FAIL - connection to 1st HDD lost"
echo "It seems there was a POWEROUTAGE while connecting the 2nd HDD."
echo "Try to avoid this next time by adding extra Power or connect more securely."
echo "You need now to reboot with 'sudo shutdown -r now' and then try again."
exit 1
fi
hddB=$(lsblk | grep -c sdb1)
if [ ${hddB} -eq 1 ]; then if [ ${hddB} -eq 1 ]; then
echo "OK - 2nd HDD found" echo "OK - 2nd HDD found as sdb1"
ready=1
fi
hddD=$(lsblk | grep -c sdb)
if [ ${hddB} -eq 1 ]; then
echo "OK - 2nd HDD found as sdb"
ready=1 ready=1
fi fi
done done
@@ -52,16 +68,28 @@ while [ ${ready} -eq 0 ]
echo "" echo ""
echo "*** Mounting 2nd HDD ***" echo "*** Mounting 2nd HDD ***"
sudo mkdir /mnt/genesis sudo mkdir /mnt/genesis
echo "try ext4 .." echo "try ext4 on sdb1 .."
sudo mount -t ext4 /dev/sdb1 /mnt/genesis sudo mount -t ext4 /dev/sdb1 /mnt/genesis
sleep 2 sleep 2
mountOK=$(lsblk | grep -c /mnt/genesis) mountOK=$(lsblk | grep -c /mnt/genesis)
if [ ${mountOK} -eq 0 ]; then if [ ${mountOK} -eq 0 ]; then
echo "try exfat .." echo "try exfat on sdb1 .."
sudo mount -t exfat /dev/sdb1 /mnt/genesis sudo mount -t exfat /dev/sdb1 /mnt/genesis
sleep 2 sleep 2
fi fi
mountOK=$(lsblk | grep -c /mnt/genesis) mountOK=$(lsblk | grep -c /mnt/genesis)
if [ ${mountOK} -eq 0 ]; then
echo "try ext4 on sdb .."
sudo mount -t ext4 /dev/sdb /mnt/genesis
sleep 2
fi
mountOK=$(lsblk | grep -c /mnt/genesis)
if [ ${mountOK} -eq 0 ]; then
echo "try exfat on sdb.."
sudo mount -t exfat /dev/sdb /mnt/genesis
sleep 2
fi
mountOK=$(lsblk | grep -c /mnt/genesis)
if [ ${mountOK} -eq 0 ]; then if [ ${mountOK} -eq 0 ]; then
echo "FAIL - not able to mount the 2nd HDD" echo "FAIL - not able to mount the 2nd HDD"
echo "only ext4 and exfat possible" echo "only ext4 and exfat possible"

View File

@@ -75,7 +75,7 @@ echo ""
###### Start LND ###### Start LND
echo "*** Starting LND ***" echo "*** Starting LND ***"
lndRunning=$(systemctl status lnd.service 2>/dev/null | grep -c running) lndRunning=$(sudo systemctl status lnd.service 2>/dev/null | grep -c running)
if [ ${lndRunning} -eq 0 ]; then if [ ${lndRunning} -eq 0 ]; then
sed -i "5s/.*/Wants=${network}d.service/" ./assets/lnd.service sed -i "5s/.*/Wants=${network}d.service/" ./assets/lnd.service
sed -i "6s/.*/After=${network}d.service/" ./assets/lnd.service sed -i "6s/.*/After=${network}d.service/" ./assets/lnd.service
@@ -91,7 +91,7 @@ fi
lndRunning=0 lndRunning=0
while [ ${lndRunning} -eq 0 ] while [ ${lndRunning} -eq 0 ]
do do
lndRunning=$(systemctl status lnd.service | grep -c running) lndRunning=$(sudo systemctl status lnd.service | grep -c running)
if [ ${lndRunning} -eq 0 ]; then if [ ${lndRunning} -eq 0 ]; then
date +%s date +%s
echo "LND not ready yet ... waiting another 60 seconds." echo "LND not ready yet ... waiting another 60 seconds."