From adc8549845f49b935a0556a258cd30785fc578a5 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 17 Dec 2021 21:43:19 +0100 Subject: [PATCH] lnd & cl install on on if not done in fatpack --- build_sdcard.sh | 16 +++---- home.admin/config.scripts/cl.install.sh | 28 ++++++++---- home.admin/config.scripts/lnd.install.sh | 54 +++++++++++++++--------- 3 files changed, 61 insertions(+), 37 deletions(-) diff --git a/build_sdcard.sh b/build_sdcard.sh index 5c86e0ffb..0d37336d4 100755 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -652,21 +652,21 @@ echo # LND # ####### echo -#if [ "${fatpack}" == "true" ]; then +if [ "${fatpack}" == "true" ]; then /home/admin/config.scripts/lnd.install.sh install || exit 1 -#else -# echo -e "\nSkipping LND install - let user install later if needed ..." -#fi +else + echo -e "\nSkipping LND install - let user install later if needed ..." +fi ############### # C-LIGHTNING # ############### echo -#if [ "${fatpack}" == "true" ]; then +if [ "${fatpack}" == "true" ]; then /home/admin/config.scripts/cl.install.sh install || exit 1 -#else -# echo -e "\nSkipping c-lightning install - let user install later if needed ..." -#fi +else + echo -e "\nSkipping c-lightning install - let user install later if needed ..." +fi echo echo "*** raspiblitz.info ***" diff --git a/home.admin/config.scripts/cl.install.sh b/home.admin/config.scripts/cl.install.sh index 5e6b8b931..d067d78f2 100644 --- a/home.admin/config.scripts/cl.install.sh +++ b/home.admin/config.scripts/cl.install.sh @@ -8,6 +8,15 @@ CLVERSION=v0.10.2 # https://github.com/ElementsProject/lightning/commit/master # CLVERSION="063366ed7e3b7cc12a8d1681acc2b639cf07fa23" +# https://github.com/ElementsProject/lightning/tree/master/contrib/keys +# PGPsigner="rustyrussel" +# PGPpkeys="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/rustyrussell.txt" +# PGPcheck="D9200E6CD1ADB8F1" + +PGPsigner="cdecker" +PGPpkeys="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/cdecker.txt" +PGPcheck="A26D6D9FE088ED58" + # help if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then echo @@ -26,16 +35,16 @@ if [ $# -eq 0 ]||[ "$1" = "-h" ]||[ "$1" = "--help" ];then fi if [ "$1" = "install" ]; then - echo "*** PREPARING C-LIGHTNING ***" - # https://github.com/ElementsProject/lightning/tree/master/contrib/keys - # PGPsigner="rustyrussel" - # PGPpkeys="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/rustyrussell.txt" - # PGPcheck="D9200E6CD1ADB8F1" + echo "# *** INSTALL C-LIGHTNING ${CLVERSION} BINARY ***" + echo "# only binary install to system" + echo "# no configuration, no systemd service" - PGPsigner="cdecker" - PGPpkeys="https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/keys/cdecker.txt" - PGPcheck="A26D6D9FE088ED58" + # check if lnd binary is already installed + if [ $(sudo -u admin lightningd 2>/dev/null --version | grep -c ".") -gt 0 ]; then + echo "c-lightning binary already installed - done" + exit 1 + fi # prepare download dir sudo rm -rf /home/admin/download/cl @@ -159,6 +168,9 @@ if [ "$1" = on ]||[ "$1" = update ]||[ "$1" = testPR ];then exit 1 fi + # make sure binary is installed (will skip if already done) + /home/admin/config.scripts/cl.install.sh install + if [ ! -f /usr/local/bin/lightningd ]||[ "$1" = "update" ]||[ "$1" = "testPR" ];then ######################## diff --git a/home.admin/config.scripts/lnd.install.sh b/home.admin/config.scripts/lnd.install.sh index adb21e8e1..114af633c 100644 --- a/home.admin/config.scripts/lnd.install.sh +++ b/home.admin/config.scripts/lnd.install.sh @@ -1,5 +1,26 @@ #!/bin/bash +# "*** LND ***" +## based on https://raspibolt.github.io/raspibolt/raspibolt_40_lnd.html#lightning-lnd +## see LND releases: https://github.com/lightningnetwork/lnd/releases +## !!!! If you change here - make sure to also change interims version in lnd.update.sh !!! +lndVersion="0.14.1-beta" + +# olaoluwa +# PGPauthor="roasbeef" +# PGPpkeys="https://keybase.io/roasbeef/pgp_keys.asc" +# PGPcheck="E4D85299674B2D31FAA1892E372CBD7633C61696" + +# guggero +PGPauthor="guggero" +PGPpkeys="https://keybase.io/guggero/pgp_keys.asc" +PGPcheck="F4FC70F07310028424EFC20A8E4256593F177720" + +# bitconner +#PGPauthor="bitconner" +#PGPpkeys="https://keybase.io/bitconner/pgp_keys.asc" +#PGPcheck="9C8D61868A7C492003B2744EE7D737B67FA592C7" + # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ];then echo @@ -18,28 +39,16 @@ if [ "${network}" == "" ]; then fi if [ "$1" = "install" ] ; then - echo "*** PREPARING LND ***" - - # "*** LND ***" - ## based on https://raspibolt.github.io/raspibolt/raspibolt_40_lnd.html#lightning-lnd - ## see LND releases: https://github.com/lightningnetwork/lnd/releases - ## !!!! If you change here - make sure to also change interims version in lnd.update.sh !!! - lndVersion="0.14.1-beta" - # olaoluwa - # PGPauthor="roasbeef" - # PGPpkeys="https://keybase.io/roasbeef/pgp_keys.asc" - # PGPcheck="E4D85299674B2D31FAA1892E372CBD7633C61696" + echo "# *** INSTALL LND ${lndVersion} BINARY ***" + echo "# only binary install to system" + echo "# no configuration, no systemd service" - # guggero - PGPauthor="guggero" - PGPpkeys="https://keybase.io/guggero/pgp_keys.asc" - PGPcheck="F4FC70F07310028424EFC20A8E4256593F177720" - - # bitconner - #PGPauthor="bitconner" - #PGPpkeys="https://keybase.io/bitconner/pgp_keys.asc" - #PGPcheck="9C8D61868A7C492003B2744EE7D737B67FA592C7" + # check if lnd binary is already installed + if [ $(sudo -u admin lnd --version 2>/dev/null| grep -c 'lnd') -gt 0 ]; then + echo "lnd binary already installed - done" + exit 1 + fi # get LND resources cd /home/admin/download || exit 1 @@ -213,6 +222,9 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "# OK will init wallet if not exists (may ask for passwordc)" fi + # make sure binary is installed (will skip if already done) + /home/admin/config.scripts/lnd.install.sh install + sudo ufw allow ${portprefix}9735 comment "${netprefix}lnd" sudo ufw allow ${portprefix}8080 comment "${netprefix}lnd REST" sudo ufw allow 1${rpcportmod}009 comment "${netprefix}lnd RPC" @@ -442,4 +454,4 @@ fi echo "# FAIL - Unknown Parameter $1" echo "# may need reboot to run" -exit 1 +exit 1 \ No newline at end of file