Browse Source

grep bug fix

#146
rootzoll 6 years ago
parent
commit
4f6eb09fd8
  1. 46
      build.sdcard/raspbianStretchDesktop.sh

46
build.sdcard/raspbianStretchDesktop.sh

@ -5,10 +5,17 @@
# https://www.raspberrypi.org/downloads/raspbian/ # https://www.raspberrypi.org/downloads/raspbian/
# SHA256: 8636ab9fdd8f58a8ec7dde33b83747696d31711d17ef68267dbbcd6cfb968c24 # SHA256: 8636ab9fdd8f58a8ec7dde33b83747696d31711d17ef68267dbbcd6cfb968c24
########################################################################## ##########################################################################
# 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:
########################################################################## ##########################################################################
# *** RASPI CONFIG *** echo ""
echo "***************************************"
echo "* RASPIBLITZ SD CARD IMAGE SETUP v0.5 *"
echo "***************************************"
echo ""
echo ""
echo "*** RASPI CONFIG ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#raspi-config # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#raspi-config
# set new default passwort for pi and root user # set new default passwort for pi and root user
@ -33,7 +40,8 @@ pip install -U tzupdate
sleep 2 sleep 2
sudo tzupdate sudo tzupdate
# *** SOFTWARE UPDATE *** echo ""
echo "*** SOFTWARE UPDATE ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#software-update # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#software-update
# installs like on RaspiBolt # installs like on RaspiBolt
@ -46,7 +54,8 @@ sudo apt-get remove -y --purge libreoffice*
sudo apt-get clean sudo apt-get clean
sudo apt-get -y autoremove sudo apt-get -y autoremove
# *** ADDING MAIN USER "admin" *** echo ""
echo "*** ADDING MAIN USER admin ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#adding-main-user-admin # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#adding-main-user-admin
# using the default password 'raspiblitz' # using the default password 'raspiblitz'
@ -58,21 +67,23 @@ sudo chsh admin -s /bin/bash
# configure sudo for usage without password entry # configure sudo for usage without password entry
sudo sed --in-place -i "7s/.*/%sudo ALL=(ALL) NOPASSWD:ALL/" /etc/sudoers sudo sed --in-place -i "7s/.*/%sudo ALL=(ALL) NOPASSWD:ALL/" /etc/sudoers
# *** ADDING SERVICE USER “bitcoin” echo "*** ADDING SERVICE USER bitcoin"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#adding-the-service-user-bitcoin # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#adding-the-service-user-bitcoin
# create user and set default password for user # create user and set default password for user
sudo adduser --disabled-password --gecos "" bitcoin sudo adduser --disabled-password --gecos "" bitcoin
echo "bitcoin:raspiblitz" | sudo chpasswd echo "bitcoin:raspiblitz" | sudo chpasswd
# *** SWAP FILE *** echo ""
echo "*** SWAP FILE ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#moving-the-swap-file # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#moving-the-swap-file
# but just deactivating and deleting old (will be created alter when user adds HDD) # but just deactivating and deleting old (will be created alter when user adds HDD)
sudo dphys-swapfile swapoff sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall sudo dphys-swapfile uninstall
# *** HARDENING *** echo ""
echo "*** HARDENING ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#hardening-your-pi # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#hardening-your-pi
# firewall - just install (not configure) # firewall - just install (not configure)
@ -81,7 +92,8 @@ sudo apt-get install -y ufw
# fail2ban (no config required) # fail2ban (no config required)
sudo apt-get install -y fail2ban sudo apt-get install -y fail2ban
# *** INCREASE OPEN FILE LIMIT *** echo ""
echo "*** INCREASE OPEN FILE LIMIT ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#increase-your-open-files-limit # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_20_pi.md#increase-your-open-files-limit
sudo sed --in-place -i "56s/.*/* soft nofile 128000/" /etc/security/limits.conf sudo sed --in-place -i "56s/.*/* soft nofile 128000/" /etc/security/limits.conf
@ -95,7 +107,8 @@ sudo sed --in-place -i "23s/.*/session required pam_limits.so/" /etc/pam.d/commo
sudo sed --in-place -i "25s/.*/session required pam_limits.so/" /etc/pam.d/common-session-noninteractive sudo sed --in-place -i "25s/.*/session required pam_limits.so/" /etc/pam.d/common-session-noninteractive
sudo bash -c "echo '# end of pam-auth-update config' >> /etc/pam.d/common-session-noninteractive" sudo bash -c "echo '# end of pam-auth-update config' >> /etc/pam.d/common-session-noninteractive"
# *** BITCOIN *** echo ""
echo "*** BITCOIN ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_30_bitcoin.md#installation # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_30_bitcoin.md#installation
# set version (change if update is available) # set version (change if update is available)
@ -142,14 +155,15 @@ fi
sudo -u admin tar -xvf bitcoin-${bitcoinVersion}-arm-linux-gnueabihf.tar.gz sudo -u admin tar -xvf bitcoin-${bitcoinVersion}-arm-linux-gnueabihf.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-${bitcoinVersion}/bin/* sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-${bitcoinVersion}/bin/*
sleep 3 sleep 3
installed=$(sudo -u admin bitcoind --version | grep '${bitcoinVersion}' -c) installed=$(sudo -u admin bitcoind --version | grep "${bitcoinVersion}" -c)
if [ ${installed} -lt 1 ]; then if [ ${installed} -lt 1 ]; then
echo "" echo ""
echo "!!! BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})" echo "!!! BUILD FAILED --> Was not able to install bitcoind version(${bitcoinVersion})"
exit 1 exit 1
fi fi
# *** LITECOIN *** echo ""
echo "*** LITECOIN ***"
# based on https://medium.com/@jason.hcwong/litecoin-lightning-with-raspberry-pi-3-c3b931a82347 # based on https://medium.com/@jason.hcwong/litecoin-lightning-with-raspberry-pi-3-c3b931a82347
# set version (change if update is available) # set version (change if update is available)
@ -158,14 +172,15 @@ cd /home/admin/download
sudo -u admin wget https://download.litecoin.org/litecoin-${litecoinVersion}/linux/litecoin-${litecoinVersion}-arm-linux-gnueabihf.tar.gz sudo -u admin wget https://download.litecoin.org/litecoin-${litecoinVersion}/linux/litecoin-${litecoinVersion}-arm-linux-gnueabihf.tar.gz
sudo -u admin tar -xvf litecoin-${litecoinVersion}-arm-linux-gnueabihf.tar.gz sudo -u admin tar -xvf litecoin-${litecoinVersion}-arm-linux-gnueabihf.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin litecoin-${litecoinVersion}/bin/* sudo install -m 0755 -o root -g root -t /usr/local/bin litecoin-${litecoinVersion}/bin/*
installed=$(sudo -u admin litecoind --version | grep '${litecoinVersion}' -c) installed=$(sudo -u admin litecoind --version | grep "${litecoinVersion}" -c)
if [ ${installed} -lt 1 ]; then if [ ${installed} -lt 1 ]; then
echo "" echo ""
echo "!!! BUILD FAILED --> Was not able to install litecoind version(${litecoinVersion})" echo "!!! BUILD FAILED --> Was not able to install litecoind version(${litecoinVersion})"
exit 1 exit 1
fi fi
# *** LND *** echo ""
echo "*** LND ***"
# based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_40_lnd.md#lightning-lnd # based on https://github.com/Stadicus/guides/blob/master/raspibolt/raspibolt_40_lnd.md#lightning-lnd
lndVersion="0.4.2-beta" lndVersion="0.4.2-beta"
@ -250,14 +265,15 @@ fi
sudo -u admin tar -xzf lnd-linux-arm-v${lndVersion}.tar.gz sudo -u admin tar -xzf lnd-linux-arm-v${lndVersion}.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-arm-v${lndVersion}/* sudo install -m 0755 -o root -g root -t /usr/local/bin lnd-linux-arm-v${lndVersion}/*
sleep 3 sleep 3
installed=$(sudo -u admin lnd --version | grep '${lndVersion}' -c) installed=$(sudo -u admin lnd --version | grep "${lndVersion}" -c)
if [ ${installed} -lt 1 ]; then if [ ${installed} -lt 1 ]; then
echo "" echo ""
echo "!!! BUILD FAILED --> Was not able to install LND version(${lndVersion})" echo "!!! BUILD FAILED --> Was not able to install LND version(${lndVersion})"
exit 1 exit 1
fi fi
# *** RASPIBLITZ EXTRAS *** echo ""
echo "*** RASPIBLITZ EXTRAS ***"
# for setup schell scripts # for setup schell scripts
sudo apt-get -y install dialog bc sudo apt-get -y install dialog bc

Loading…
Cancel
Save