diff --git a/CHANGES.md b/CHANGES.md index 2d24b95dd..5967e3fbd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,14 +19,14 @@ - Update: Lightning Terminal v0.8.6-alpha [details](https://github.com/lightninglabs/lightning-terminal/releases/tag/v0.8.6-alpha) - Update: RTL v0.13.6 with update option [details](https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.13.6) - Update: Thunderhub v0.13.16 with balance sharing disabled [details](https://github.com/apotdevin/thunderhub/releases/tag/v0.13.16) -- Update: LNbits 0.10.2 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.2) -- Update: BTCPayServer 1.9.1 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.9.1) +- Update: LNbits 0.10.6 [details](https://github.com/lnbits/lnbits/releases/tag/0.10.6) +- Update: BTCPayServer 1.9.3 (postgres by default with sqlite migration) [details](https://github.com/btcpayserver/btcpayserver/releases/tag/v1.9.3) - Update: ItchySats 0.7.0 [details](https://github.com/itchysats/itchysats/releases/tag/0.7.0) - Update: Channel Tools (chantools) v0.10.5 [details](https://github.com/guggero/chantools/releases/tag/v0.10.5) - Update: JoinMarket v0.9.9 [details](https://github.com/JoinMarket-Org/joinmarket-clientserver/releases/tag/v0.9.9) - Update: JoininBox v0.7.7 [details](https://github.com/openoms/joininbox/releases/tag/v0.7.7) - Update: Balance of Satoshis 13.15.0 (bos) [details](https://github.com/alexbosworth/balanceofsatoshis/blob/master/CHANGELOG.md#13150) -- Update: lndmanage 0.14.2 [details](https://github.com/bitromortac/lndmanage) +- Update: lndmanage 0.15.0 [details](https://github.com/bitromortac/lndmanage) - Update: Circuitbreaker with webUI [details](https://github.com/lightningequipment/circuitbreaker/blob/master/README.md) - Update: Suez - Channel Visualization for LND & CL [details](https://github.com/prusnak/suez) - Update: Tallycoin Connect v1.8.0 [details](https://github.com/djbooth007/tallycoin_connect/releases/tag/v1.8.0) diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index bd525df63..b21abb556 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -276,7 +276,7 @@ ${color_yellow}${ln_publicColor}${ln_external}${color_gray}" if [ "${joinmarket}" = "on" ];then # show JoinMarket stats in place of the LND URI only if the Yield Generator is running if [ "$(sudo -u joinmarket pgrep -f "yg-privacyenhanced.py" 2>/dev/null | wc -l)" -gt 2 ] || \ - [ "$(curl -ksX GET https://127.0.0.1:28183/api/v1/session | jq .maker_running)" = true ]; then + [ "$(curl -ksX GET https://127.0.0.1:28183/api/v1/session | jq .maker_running 2>/dev/null)" = true ]; then trap 'rm -f "$JMstats"' EXIT JMstats=$(mktemp -p /dev/shm) diff --git a/home.admin/00settingsMenuBasics.sh b/home.admin/00settingsMenuBasics.sh index 1535eba41..78e115982 100755 --- a/home.admin/00settingsMenuBasics.sh +++ b/home.admin/00settingsMenuBasics.sh @@ -440,14 +440,8 @@ if [ "${clNode}" != "${choice}" ]; then /home/admin/config.scripts/cl.install.sh on signet fi - # make sure that cln-grpc is on for the WebAPI - echo "# install the cln-grpc plugin" - /home/admin/config.scripts/cl-plugin.cln-grpc.sh install - /home/admin/config.scripts/cl-plugin.cln-grpc.sh on - else echo "# turning OFF" - /home/admin/config.scripts/cl-plugin.cln-grpc.sh off /home/admin/config.scripts/cl.install.sh off mainnet /home/admin/config.scripts/cl.install.sh off testnet /home/admin/config.scripts/cl.install.sh off signet diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index a822a46dc..24c5a5354 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -457,11 +457,11 @@ if [ ${isMounted} -eq 0 ]; then /home/admin/config.scripts/blitz.datadrive.sh status >> ${logFile} # determine correct setup phase - infoMessage="Please Login for Setup" + infoMessage="Please start Setup" setupPhase="setup" if [ "${hddGotMigrationData}" != "" ]; then - infoMessage="Please Login for Migration" + infoMessage="Please start Migration" setupPhase="migration" # check if lightning is outdated migrationMode="normal" @@ -480,10 +480,10 @@ if [ ${isMounted} -eq 0 ]; then # TODO: improve version/update detection later isRecovery=$(echo "${hddRaspiVersion}" | grep -c "${codeVersion}") if [ "${isRecovery}" == "1" ]; then - infoMessage="Please Login for Recovery" + infoMessage="Please start Recovery" setupPhase="recovery" else - infoMessage="Please Login for Update" + infoMessage="Please start Update" setupPhase="update" fi diff --git a/home.admin/_provision.setup.sh b/home.admin/_provision.setup.sh index 2e2ea9b58..721820668 100755 --- a/home.admin/_provision.setup.sh +++ b/home.admin/_provision.setup.sh @@ -342,10 +342,6 @@ if [ "${lightning}" == "cl" ]; then /home/admin/_cache.sh set message "Core Lightning Setup" /home/admin/config.scripts/cl.install.sh on mainnet >> ${logFile} - echo "# switch cln-grpc on" >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh install >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh on >> ${logFile} - # OLD WALLET FROM CLIGHTNING RESCUE if [ "${clrescue}" != "" ]; then diff --git a/home.admin/_provision_.sh b/home.admin/_provision_.sh index 0c272b30c..905ebca48 100755 --- a/home.admin/_provision_.sh +++ b/home.admin/_provision_.sh @@ -315,9 +315,6 @@ if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ] || [ "${tcl}" == "on" ] || # if already installed by fatpack will skip echo "Provisioning Core Lightning Binary - run config script" >> ${logFile} /home/admin/config.scripts/cl.install.sh install >> ${logFile} 2>&1 - echo "Provisioning cl-plugin.cln-grpc.sh - run config script" >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh install >> ${logFile} - /home/admin/config.scripts/cl-plugin.cln-grpc.sh on >> ${logFile} else echo "Provisioning Core Lightning Binary - not active" >> ${logFile} fi @@ -346,6 +343,7 @@ else echo "Provisioning CL Signet - not active" >> ${logFile} fi + # TOR if [ "${runBehindTor}" == "on" ]; then echo "Provisioning TOR - run config script" >> ${logFile} diff --git a/home.admin/assets/bitcoind.service b/home.admin/assets/bitcoind.service index b8446426b..5062983f8 100644 --- a/home.admin/assets/bitcoind.service +++ b/home.admin/assets/bitcoind.service @@ -10,6 +10,7 @@ Wants=network-online.target #OnFailure=systemd-sendmail@%n [Service] +Environment='MALLOC_ARENA_MAX=1' ExecStartPre=-/home/admin/config.scripts/blitz.systemd.sh log blockchain STARTED ExecStart=/usr/local/bin/bitcoind -daemonwait \ -conf=/mnt/hdd/bitcoin/bitcoin.conf \ diff --git a/home.admin/config.scripts/bitcoin.install.sh b/home.admin/config.scripts/bitcoin.install.sh index b7cb5157c..d89fa3586 100644 --- a/home.admin/config.scripts/bitcoin.install.sh +++ b/home.admin/config.scripts/bitcoin.install.sh @@ -254,6 +254,7 @@ After=network-online.target Wants=network-online.target [Service] +Environment='MALLOC_ARENA_MAX=1' ExecStart=/usr/local/bin/bitcoind -${CHAIN} \\ -daemonwait \\ -conf=/mnt/hdd/bitcoin/bitcoin.conf \\ diff --git a/home.admin/config.scripts/blitz.debug.sh b/home.admin/config.scripts/blitz.debug.sh index a3743fc5c..d47b10c09 100755 --- a/home.admin/config.scripts/blitz.debug.sh +++ b/home.admin/config.scripts/blitz.debug.sh @@ -238,10 +238,11 @@ echo "--> CHECK CONFIG: sudo nginx -t" sudo nginx -t 2>&1 echo +echo "*** BLITZAPI STATUS ***" +/home/admin/config.scripts/blitz.web.api.sh info if [ $(sudo systemctl status blitzapi 2>/dev/null | grep -c "blitzapi.service") -lt 1 ]; then echo "- BLITZAPI is not running" else - echo "*** BLITZAPI SYSTEMD STATUS ***" sudo systemctl status blitzapi -n2 --no-pager echo @@ -251,6 +252,10 @@ else echo fi +echo "*** BLITZ WebUI STATUS ***" +/home/admin/config.scripts/blitz.web.ui.sh info +echo + if [ "${touchscreen}" == "" ] || [ "${touchscreen}" == "0" ] || [ "${touchscreen}" == "off" ]; then echo "- TOUCHSCREEN is OFF by config" else diff --git a/home.admin/config.scripts/blitz.fatpack.sh b/home.admin/config.scripts/blitz.fatpack.sh index 8beaafaaa..3d0e8e3eb 100755 --- a/home.admin/config.scripts/blitz.fatpack.sh +++ b/home.admin/config.scripts/blitz.fatpack.sh @@ -9,6 +9,9 @@ if [ "$EUID" -ne 0 ] exit 1 fi +# make sure LCD is on (default for fatpack) +/home/admin/config.scripts/blitz.display.sh set-display lcd + # check if sd card needs expansion before fatpack source <(sudo /home/admin/config.scripts/blitz.bootdrive.sh status) if [ "${needsExpansion}" == "1" ]; then @@ -71,8 +74,6 @@ echo "* Adding LND ..." echo "* Adding Core Lightning ..." /home/admin/config.scripts/cl.install.sh install || exit 1 -echo "* Adding the cln-grpc plugin ..." -/home/admin/config.scripts/cl-plugin.cln-grpc.sh install || exit 1 # *** AUTO UPDATE FALLBACK NODE LIST FROM INTERNET (only in fatpack) echo "*** FALLBACK NODE LIST ***" diff --git a/home.admin/config.scripts/blitz.git-verify.sh b/home.admin/config.scripts/blitz.git-verify.sh index 91ebc6a58..eb0706d96 100644 --- a/home.admin/config.scripts/blitz.git-verify.sh +++ b/home.admin/config.scripts/blitz.git-verify.sh @@ -43,6 +43,7 @@ if [ $? -ne 0 ]; then fi fi +echo "# importing key of ${PGPsigner}" gpg --import --import-options show-only /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc fingerprint=$(gpg --show-keys --keyid-format LONG /var/cache/raspiblitz/pgp_keys_${PGPsigner}.asc 2>/dev/null | grep "${PGPpubkeyFingerprint}" -c) if [ "${fingerprint}" -lt 1 ]; then diff --git a/home.admin/config.scripts/blitz.web.api.sh b/home.admin/config.scripts/blitz.web.api.sh index e90abb981..82f91752d 100644 --- a/home.admin/config.scripts/blitz.web.api.sh +++ b/home.admin/config.scripts/blitz.web.api.sh @@ -12,6 +12,7 @@ FALLACK_BRANCH="dev" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then echo "Manage RaspiBlitz Web API" + echo "blitz.web.api.sh info" echo "blitz.web.api.sh on [GITHUBUSER] [REPO] [BRANCH] [?COMMITORTAG]" echo "blitz.web.api.sh on DEFAULT" echo "blitz.web.api.sh update-config" @@ -20,6 +21,34 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; exit 1 fi +################### +# INFO +################### +if [ "$1" = "info" ]; then + + # check if installed + cd /home/blitzapi/blitz_api + if [ "$?" != "0" ]; then + echo "installed=0" + exit 1 + fi + echo "installed=1" + + # get github origin repo from repo directory with git command + origin=$(sudo -u blitzapi git config --get remote.origin.url) + echo "repo='${origin}'" + + # get github branch from repo directory with git command + branch=$(sudo -u blitzapi git rev-parse --abbrev-ref HEAD) + echo "branch='${branch}'" + + # get github commit from repo directory with git command + commit=$(sudo -u blitzapi git rev-parse HEAD) + echo "commit='${commit}'" + + exit 0 +fi + ################### # UPDATE CONFIG ################### @@ -98,9 +127,6 @@ if [ "$1" = "update-config" ]; then sed -i "s/^ln_node=.*/ln_node=cln_jrpc/g" ./.env sed -i "s#^cln_jrpc_path=.*#cln_jrpc_path=\"/mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc\"#g" ./.env - # make sure cln-grpc is on - # sudo /home/admin/config.scripts/cl-plugin.cln-grpc.sh on mainnet - # get hex values of pem files # hexClient=$(sudo xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client.pem) # hexClientKey=$(sudo xxd -p -c2000 /home/bitcoin/.lightning/bitcoin/client-key.pem) diff --git a/home.admin/config.scripts/blitz.web.ui.sh b/home.admin/config.scripts/blitz.web.ui.sh index 65b392812..13502db38 100755 --- a/home.admin/config.scripts/blitz.web.ui.sh +++ b/home.admin/config.scripts/blitz.web.ui.sh @@ -9,6 +9,7 @@ FALLACK_BRANCH="master" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; then echo "Manage RaspiBlitz WebUI" + echo "blitz.web.ui.sh info" echo "blitz.web.ui.sh on [GITHUBUSER] [REPO] [BRANCH] [?COMMITORTAG]" echo "blitz.web.ui.sh on DEFAULT" echo "blitz.web.ui.sh update" @@ -16,6 +17,34 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; exit 0 fi +################### +# INFO +################### +if [ "$1" = "info" ]; then + + # check if installed + cd /home/blitzapi/blitz_web + if [ "$?" != "0" ]; then + echo "installed=0" + exit 1 + fi + echo "installed=1" + + # get github origin repo from repo directory with git command + origin=$(sudo git config --get remote.origin.url) + echo "repo='${origin}'" + + # get github branch from repo directory with git command + branch=$(sudo git rev-parse --abbrev-ref HEAD) + echo "branch='${branch}'" + + # get github commit from repo directory with git command + commit=$(sudo git rev-parse HEAD) + echo "commit='${commit}'" + + exit 0 +fi + # check if started with sudo if [ "$EUID" -ne 0 ]; then echo "error='run as root'" diff --git a/home.admin/config.scripts/bonus.btcpayserver.sh b/home.admin/config.scripts/bonus.btcpayserver.sh index 625487456..9b4bae5ba 100644 --- a/home.admin/config.scripts/bonus.btcpayserver.sh +++ b/home.admin/config.scripts/bonus.btcpayserver.sh @@ -5,12 +5,12 @@ # https://github.com/dgarage/NBXplorer/tags NBXplorerVersion="v2.3.62" # https://github.com/btcpayserver/btcpayserver/releases -BTCPayVersion="v1.9.1" +BTCPayVersion="v1.9.3" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "Config script to switch BTCPay Server on or off" - echo "Usage:" + echo "bonus.btcpayserver.sh menu" echo "bonus.btcpayserver.sh [install|uninstall]" echo "bonus.btcpayserver.sh [on|off|menu|write-tls-macaroon|cln-lightning-rpc-access]" echo "installs BTCPayServer $BTCPayVersion with NBXplorer $NBXplorerVersion" @@ -405,12 +405,19 @@ if [ "$1" = "install" ]; then cd btcpayserver || exit 1 sudo -u btcpay git reset --hard $BTCPayVersion #sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh "web-flow" "https://github.com/web-flow.gpg" "4AEE18F83AFDEB23" || exit 1 - PGPsigner="nicolasdorier" - PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc" - PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE" + #PGPsigner="nicolasdorier" + #PGPpubkeyLink="https://keybase.io/nicolasdorier/pgp_keys.asc" + #PGPpubkeyFingerprint="AB4CFA9895ACA0DBE27F6B346618763EF09186FE" + # --- #PGPsigner="Kukks" #PGPpubkeyLink="https://github.com/${PGPsigner}.gpg" #PGPpubkeyFingerprint="8E5530D9D1C93097" + # --- + PGPsigner="web-flow" + PGPpubkeyLink="https://github.com/web-flow.gpg" + PGPpubkeyFingerprint="4AEE18F83AFDEB23" + + echo "# verify signature of ${PGPsigner}" sudo -u btcpay /home/admin/config.scripts/blitz.git-verify.sh "${PGPsigner}" "${PGPpubkeyLink}" "${PGPpubkeyFingerprint}" || exit 1 echo "# Build BTCPayServer $BTCPayVersion" @@ -434,14 +441,16 @@ if [ "$1" = "uninstall" ]; then fi # clear dotnet cache - /home/btcpay/dotnet/dotnet nuget locals all --clear + /home/btcpay/dotnet/dotnet nuget locals all --clear 2>/dev/null # remove dotnet - sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/share/dotnet 2>/dev/null # nuke user sudo userdel -rf btcpay 2>/dev/null + echo "# uninstall done" + exit 0 fi diff --git a/home.admin/config.scripts/bonus.joinmarket.sh b/home.admin/config.scripts/bonus.joinmarket.sh index 36cfdc503..bce8aa9a1 100755 --- a/home.admin/config.scripts/bonus.joinmarket.sh +++ b/home.admin/config.scripts/bonus.joinmarket.sh @@ -6,7 +6,7 @@ # https://github.com/openoms/joininbox # https://github.com/openoms/joininbox/tags -JBTAG="v0.7.7" # installs JoinMarket v0.9.9 +JBTAG="v0.7.8" # installs JoinMarket v0.9.9 # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then diff --git a/home.admin/config.scripts/bonus.lit.sh b/home.admin/config.scripts/bonus.lit.sh index d624e2e4d..49c88fb5c 100644 --- a/home.admin/config.scripts/bonus.lit.sh +++ b/home.admin/config.scripts/bonus.lit.sh @@ -5,10 +5,10 @@ LITVERSION="0.9.2-alpha" # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then - echo "config script to switch the Lightning Terminal Service on or off" - echo "installs the version $LITVERSION" - echo "bonus.lit.sh [on|off|menu]" - exit 1 + echo "config script to switch the Lightning Terminal Service on or off" + echo "installs the version $LITVERSION" + echo "bonus.lit.sh [on|off|menu]" + exit 1 fi # check who signed the release in https://github.com/lightninglabs/lightning-terminal/releases @@ -78,16 +78,16 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # switching off single installs of pool, loop or faraday if installed if [ "${loop}" = "on" ]; then - echo "# Replacing single install of: LOOP" - /home/admin/config.scripts/bonus.loop.sh off + echo "# Replacing single install of: LOOP" + /home/admin/config.scripts/bonus.loop.sh off fi if [ "${pool}" = "on" ]; then - echo "# Replacing single install of: POOL" - /home/admin/config.scripts/bonus.pool.sh off + echo "# Replacing single install of: POOL" + /home/admin/config.scripts/bonus.pool.sh off fi if [ "${faraday}" = "on" ]; then - echo "# Replacing single install of: FARADAY" - /home/admin/config.scripts/bonus.faraday.sh off + echo "# Replacing single install of: FARADAY" + /home/admin/config.scripts/bonus.faraday.sh off fi isInstalled=$(sudo ls /etc/systemd/system/litd.service 2>/dev/null | grep -c 'litd.service') @@ -96,7 +96,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then # create dedicated user sudo adduser --disabled-password --gecos "" lit # make sure symlink to central app-data directory exists - sudo rm -rf /home/lit/.lnd # not a symlink.. delete it silently + sudo rm -rf /home/lit/.lnd # not a symlink.. delete it silently # create symlink sudo ln -s "/mnt/hdd/app-data/lnd/" "/home/lit/.lnd" @@ -160,21 +160,21 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then uname -m exit 1 else - echo "OK running on $(uname -m) architecture." + echo "OK running on $(uname -m) architecture." fi - downloadDir="/home/admin/download/lit" # edit your download directory + downloadDir="/home/admin/download/lit" # edit your download directory rm -rf "${downloadDir}" mkdir -p "${downloadDir}" cd "${downloadDir}" || exit 1 # extract the SHA256 hash from the manifest file for the corresponding platform wget -N https://github.com/lightninglabs/lightning-terminal/releases/download/v${LITVERSION}/manifest-v${LITVERSION}.txt - if [ ${isARM} -eq 1 ] ; then + if [ ${isARM} -eq 1 ]; then OSversion="armv7" - elif [ ${isAARCH64} -eq 1 ] ; then + elif [ ${isAARCH64} -eq 1 ]; then OSversion="arm64" - elif [ ${isX86_64} -eq 1 ] ; then + elif [ ${isX86_64} -eq 1 ]; then OSversion="amd64" fi SHA256=$(grep -i "linux-$OSversion" manifest-v$LITVERSION.txt | cut -d " " -f1) @@ -198,8 +198,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then echo "# check gpg finger print" gpg --show-keys --keyid-format LONG ./pgp_keys.asc - fingerprint=$(gpg --show-keys --keyid-format LONG "./pgp_keys.asc" 2>/dev/null \ - | grep "${PGPcheck}" -c) + fingerprint=$(gpg --show-keys --keyid-format LONG "./pgp_keys.asc" 2>/dev/null | + grep "${PGPcheck}" -c) if [ ${fingerprint} -lt 1 ]; then echo "" echo "# BUILD WARNING --> LiT PGP author not as expected" @@ -209,7 +209,10 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then fi gpg --import ./pgp_keys.asc sleep 3 - verifyResult=$(LANG=en_US.utf8; gpg --verify manifest-v${LITVERSION}.sig manifest-v${LITVERSION}.txt 2>&1) + verifyResult=$( + LANG=en_US.utf8 + gpg --verify manifest-v${LITVERSION}.sig manifest-v${LITVERSION}.txt 2>&1 + ) goodSignature=$(echo ${verifyResult} | grep 'Good signature' -c) echo "goodSignature(${goodSignature})" correctKey=$(echo ${verifyResult} | tr -d " \t\n\r" | grep "${GPGcheck}" -c) @@ -235,17 +238,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then ########### # config # ########### - - # check if lnd.conf has rpcmiddleware.enable entry under section Application Options - entryExists=$(sudo cat /mnt/hdd/lnd/lnd.conf | grep -c "rpcmiddleware.enable=") - if [ "${entryExists}" == "0" ]; then - echo "# add rpcmiddleware.enable=true to lnd.conf" - sudo sed -i "/^\[Application Options\]$/arpcmiddleware.enable=true" /mnt/hdd/lnd/lnd.conf + # check if lnd.conf has rpcmiddleware.enable entry under [rpcmiddleware] + if sudo grep rpcmiddleware /mnt/hdd/lnd/lnd.conf; then + sudo sed -i "s/^rpcmiddleware.enable=.*/rpcmiddleware.enable=true/g" /mnt/hdd/lnd/lnd.conf + else + sudo bash -c "echo '[rpcmiddleware]' >> /mnt/hdd/lnd/lnd.conf" + sudo bash -c "echo 'rpcmiddleware.enable=true' >> /mnt/hdd/lnd/lnd.conf" fi - # make sure lnd.conf has rpcmiddleware.enable=true - sudo sed -i "s/^rpcmiddleware.enable=.*/rpcmiddleware.enable=true/g" /mnt/hdd/lnd/lnd.conf - if [ "${runBehindTor}" = "on" ]; then echo "# Connect to the Pool, Loop and Terminal server through Tor" LOOPPROXY="loop.server.proxy=127.0.0.1:9050" @@ -408,4 +408,3 @@ fi echo "FAIL - Unknown Parameter $1" echo "may need reboot to run normal again" exit 1 - diff --git a/home.admin/config.scripts/bonus.lnbits.sh b/home.admin/config.scripts/bonus.lnbits.sh index 1337f7b6c..3d18c9e88 100644 --- a/home.admin/config.scripts/bonus.lnbits.sh +++ b/home.admin/config.scripts/bonus.lnbits.sh @@ -3,7 +3,7 @@ # https://github.com/lnbits/lnbits # https://github.com/lnbits/lnbits/releases -tag="0.10.4.1" +tag="0.10.6" VERSION="${tag}" # command info @@ -14,7 +14,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "bonus.lnbits.sh [install|uninstall] [?GITHUBUSER] [?BRANCH|?TAG]" echo "bonus.lnbits.sh on [lnd|tlnd|slnd|cl|tcl|scl]" echo "bonus.lnbits.sh switch [lnd|tlnd|slnd|cl|tcl|scl]" - echo "bonus.lnbits.sh off" + echo "bonus.lnbits.sh off <--keep-data|--delete-data>" echo "bonus.lnbits.sh status" echo "bonus.lnbits.sh menu" echo "bonus.lnbits.sh prestart" @@ -580,7 +580,11 @@ if [ "$1" = "sync" ] || [ "$1" = "repo" ]; then sudo -u lnbits git pull # check if poetry in installed, if not install it - sudo -u lnbits which poetry || sudo -u lnbits curl -sSL https://install.python-poetry.org | sudo -u lnbits python3 - + if ! sudo -u lnbits which poetry; then + echo "# install poetry" + sudo pip3 install --upgrade pip + sudo pip3 install poetry + fi # do install like this sudo -u lnbits poetry install @@ -597,13 +601,12 @@ sudo systemctl stop lnbits 2>/dev/null if [ "$1" = "install" ]; then # check if already installed - isInstalled=$(compgen -u | grep -c lnbits) - if [ "${isInstalled}" != "0" ]; then + if compgen -u | grep -w lnbits; then echo "result='already installed'" exit 0 fi - echo "# *** INSTALL LNBIS ${VERSION} ***" + echo "# *** INSTALL LNBITS ${VERSION} ***" # add lnbits user echo "*** Add the 'lnbits' user ***" @@ -661,12 +664,18 @@ if [ "$1" = "uninstall" ]; then fi -# install +# on if [ "$1" = "1" ] || [ "$1" = "on" ]; then - # check if code is already installed - isInstalled=$(compgen -u | grep -c lnbits) - if [ "${isInstalled}" == "0" ]; then + # check if already installed + if compgen -u | grep -w lnbits; then + # check poetry if the user exists + if ! sudo -u lnbits which poetry; then + echo "# Fix faulty installation" + /home/admin/config.scripts/bonus.lnbits.sh off --keep-data + /home/admin/config.scripts/bonus.lnbits.sh install || exit 1 + fi + else echo "# Installing code base & dependencies first .." /home/admin/config.scripts/bonus.lnbits.sh install || exit 1 fi @@ -987,12 +996,12 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then sudo systemctl stop lnbits sudo systemctl disable lnbits sudo rm /etc/systemd/system/lnbits.service - echo "OK lnbits.service removed." + echo "# OK lnbits.service removed." else - echo "lnbits.service is not installed." + echo "# lnbits.service is not installed." fi - echo "Cleaning up LNbits install ..." + echo "# Cleaning up LNbits install ..." sudo ufw delete allow 5000 sudo ufw delete allow 5001 @@ -1020,6 +1029,9 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then echo "# keeping data" fi + echo "# Remove the lnbits user" + sudo userdel -rf lnbits 2>/dev/null + # setting value in raspi blitz config /home/admin/config.scripts/blitz.conf.sh set LNBits "off" diff --git a/home.admin/config.scripts/bonus.lndmanage.sh b/home.admin/config.scripts/bonus.lndmanage.sh index 5337e6430..a4791fbd3 100755 --- a/home.admin/config.scripts/bonus.lndmanage.sh +++ b/home.admin/config.scripts/bonus.lndmanage.sh @@ -9,7 +9,7 @@ fi # set version of LND manage to install # https://github.com/bitromortac/lndmanage/releases -lndmanageVersion="0.14.2" +lndmanageVersion="0.15.0" pgpKeyDownload="https://github.com/bitromortac.gpg" gpgFingerprint="0453B9F5071261A40FDB34181965063FC13BEBE2" diff --git a/home.admin/config.scripts/cl.check.sh b/home.admin/config.scripts/cl.check.sh index 3894a3748..300af6753 100644 --- a/home.admin/config.scripts/cl.check.sh +++ b/home.admin/config.scripts/cl.check.sh @@ -6,6 +6,7 @@ if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "-help" ]; echo "# script to check CL states" echo "# cl.check.sh basic-setup" echo "# cl.check.sh prestart [mainnet|testnet|signet]" + echo "# cl.check.sh poststart [mainnet|testnet|signet]" echo exit 1 fi @@ -17,71 +18,95 @@ source <(/home/admin/config.scripts/network.aliases.sh getvars cl $2) ###################################################################### # PRESTART -# is executed by systemd cl services everytime before cl is started +# is executed by systemd cl services everytime BEFORE cl is started # so it tries to make sure the config is in valid shape ###################################################################### -# make sure plugins are loaded https://github.com/rootzoll/raspiblitz/issues/2953 -if [ $(grep -c "^plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" < ${CLCONF}) -eq 0 ];then - echo "plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" | tee -a ${CLCONF} -fi +if [ "$1" == "prestart" ]; then -# do not announce 127.0.0.1 https://github.com/rootzoll/raspiblitz/issues/2634 -if [ $(grep -c "^announce-addr=127.0.0.1" < ${CLCONF}) -gt 0 ];then - sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF} -fi - -if [ $(grep -c "^sparko" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]\ - || [ "$(eval echo \$${netprefix}sparko)" != "on" ]; then - echo "# The Sparko plugin is not present but in config" - sed -i "/^sparko/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko + # make sure plugins are loaded https://github.com/rootzoll/raspiblitz/issues/2953 + if [ $(grep -c "^plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" < ${CLCONF}) -eq 0 ];then + echo "plugin-dir=/home/bitcoin/${netprefix}cl-plugins-enabled" | tee -a ${CLCONF} fi + + # do not announce 127.0.0.1 https://github.com/rootzoll/raspiblitz/issues/2634 + if [ $(grep -c "^announce-addr=127.0.0.1" < ${CLCONF}) -gt 0 ];then + sed -i "/^announce-addr=127.0.0.1/d" ${CLCONF} + fi + + if [ $(grep -c "^sparko" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/sparko ]\ + || [ "$(eval echo \$${netprefix}sparko)" != "on" ]; then + echo "# The Sparko plugin is not present but in config" + sed -i "/^sparko/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/sparko + fi + fi + + if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\ + || [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then + echo "# The clboss plugin is not present but in config" + sed -i "/^clboss/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/clboss + fi + fi + + if [ $(grep -c "^http-pass" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]\ + || [ "${clHTTPplugin}" != "on" ]; then + echo "# The clHTTPplugin is not present but in config" + sed -i "/^http-pass/d" ${CLCONF} + rm -rf /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin + fi + fi + + if [ $(grep -c "^feeadjuster" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]\ + || [ "$(eval echo \$${netprefix}feeadjuster)" != "on" ]; then + echo "# The feeadjuster plugin is not present but in config" + sed -i "/^feeadjuster/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py + fi + fi + + # https://github.com/rootzoll/raspiblitz/issues/3007 + # add for test networks as well if needed on mainnet + if [ "${blitzapi}" = "on" ] || \ + [ "${LNBitsFunding}" = "${netprefix}cl" ] || \ + [ "${BTCPayServer}" = "on" ]; then + if [ $(grep -c "^rpc-file-mode=0660" < ${CLCONF}) -eq 0 ]; then + echo "rpc-file-mode=0660" | tee -a ${CLCONF} + fi + fi + + if [ $(grep -c "^grpc-port" < ${CLCONF}) -gt 0 ];then + if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ]\ + || [ "$(eval echo \$${netprefix}cln-grpc-port)" = "off" ]; then + echo "# The cln-grpc plugin is not present but in config" + sed -i "/^grpc-port/d" ${CLCONF} + rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc + fi + fi + + + exit 0 fi -if [ $(grep -c "^clboss" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/clboss ]\ - || [ "$(eval echo \$${netprefix}clboss)" != "on" ]; then - echo "# The clboss plugin is not present but in config" - sed -i "/^clboss/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/clboss - fi +###################################################################### +# POSTSTART +# is executed by systemd cl services everytime AFTER cl is started +# takes care of things that are just available when CL is running +###################################################################### + +if [ "$1" == "poststart" ]; then + + # log info + info=$(ls -la /mnt/hdd/app-data/.lightning/bitcoin/lightning-rpc) + logger "${info}" + + exit 0 fi -if [ $(grep -c "^http-pass" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin ]\ - || [ "${clHTTPplugin}" != "on" ]; then - echo "# The clHTTPplugin is not present but in config" - sed -i "/^http-pass/d" ${CLCONF} - rm -rf /home/bitcoin/cl-plugins-enabled/c-lightning-http-plugin - fi -fi - -if [ $(grep -c "^feeadjuster" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py ]\ - || [ "$(eval echo \$${netprefix}feeadjuster)" != "on" ]; then - echo "# The feeadjuster plugin is not present but in config" - sed -i "/^feeadjuster/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/feeadjuster.py - fi -fi - -# https://github.com/rootzoll/raspiblitz/issues/3007 -# add for test networks as well if needed on mainnet -if [ "${blitzapi}" = "on" ] || \ - [ "${LNBitsFunding}" = "${netprefix}cl" ] || \ - [ "${BTCPayServer}" = "on" ]; then - if [ $(grep -c "^rpc-file-mode=0660" < ${CLCONF}) -eq 0 ]; then - echo "rpc-file-mode=0660" | tee -a ${CLCONF} - fi -fi - -if [ $(grep -c "^grpc-port" < ${CLCONF}) -gt 0 ];then - if [ ! -f /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc ]\ - || [ "$(eval echo \$${netprefix}cln-grpc-port)" = "off" ]; then - echo "# The cln-grpc plugin is not present but in config" - sed -i "/^grpc-port/d" ${CLCONF} - rm -rf /home/bitcoin/${netprefix}cl-plugins-enabled/cln-grpc - fi -fi +echo "# Unkonwn Parameter $1 or missing" +exit 1 diff --git a/home.admin/config.scripts/cl.install-service.sh b/home.admin/config.scripts/cl.install-service.sh index 98e79aaca..047b9cf86 100644 --- a/home.admin/config.scripts/cl.install-service.sh +++ b/home.admin/config.scripts/cl.install-service.sh @@ -61,9 +61,8 @@ After=network-online.target [Service] ExecStartPre=-/home/admin/config.scripts/cl.check.sh prestart $CHAIN -ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd \\ - --conf=${CLCONF} ${encryptedHSMoption} \\ - --pid-file=/run/lightningd/${netprefix}lightningd.pid' +ExecStart=/bin/sh -c '${passwordInput}/usr/local/bin/lightningd --conf=${CLCONF} ${encryptedHSMoption} --pid-file=/run/lightningd/${netprefix}lightningd.pid --rpc-file-mode 0660' +ExecStartPost=-/home/admin/config.scripts/cl.check.sh poststart $CHAIN # Creates /run/lightningd owned by bitcoin RuntimeDirectory=lightningd diff --git a/home.admin/config.scripts/cl.install.sh b/home.admin/config.scripts/cl.install.sh index 424d576e3..250717d91 100644 --- a/home.admin/config.scripts/cl.install.sh +++ b/home.admin/config.scripts/cl.install.sh @@ -2,7 +2,7 @@ # https://lightning.readthedocs.io/ # https://github.com/ElementsProject/lightning/releases -CLVERSION=v23.02.2 +CLVERSION="v23.02.2" # install the latest master by using the last commit id # https://github.com/ElementsProject/lightning/commit/master diff --git a/home.admin/config.scripts/cl.update.sh b/home.admin/config.scripts/cl.update.sh index f01bf3600..91903700c 100644 --- a/home.admin/config.scripts/cl.update.sh +++ b/home.admin/config.scripts/cl.update.sh @@ -19,7 +19,7 @@ fi mode="$1" # RECOMMENDED UPDATE BY RASPIBLITZ TEAM -# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines) +# comment will be shown as "BEWARE Info" when option is choosen (can be multiple lines) clUpdateVersion="" # example: 0.12.1 .. keep empty if no newer version as sd card build is available clUpdateComment="Please keep in mind that downgrading afterwards is not tested. Also not all additional apps are fully tested with the this update - but it looked good on first tests." @@ -65,7 +65,7 @@ if [ "${mode}" = "verified" ]; then # check for optional second parameter: forced update version # --> only does the verified update if its the given version - # this is needed for recovery/update. + # this is needed for recovery/update. fixedUpdateVersion="$2" if [ ${#fixedUpdateVersion} -gt 0 ]; then echo "# checking for fixed version update: askedFor(${fixedUpdateVersion}) available(${clUpdateVersion})" @@ -78,9 +78,8 @@ if [ "${mode}" = "verified" ]; then echo "# OK - update version is matching" fi fi - - if [ ${#clUpdateVersion} -gt 0 ];then + if [ ${#clUpdateVersion} -gt 0 ]; then /home/admin/config.scripts/cl.install.sh update v${clUpdateVersion} else /home/admin/config.scripts/cl.install.sh on @@ -100,7 +99,7 @@ if [ "${mode}" = "reckless" ]; then echo "# cl.update.sh reckless" # only update if the latest release is different from the installed - if [ "v${clInstalledVersion}" = "${clLatestVersion}" ]; then + if [ "${clInstalledVersion}" = "${clLatestVersion}" ]; then # attention to leading 'v' echo "# clInstalledVersion = clLatestVersion (${clLatestVersion:1})" echo "# There is no need to update again." diff --git a/home.admin/config.scripts/internet.sh b/home.admin/config.scripts/internet.sh index fb0f3d9a8..bbe6f4ab6 100755 --- a/home.admin/config.scripts/internet.sh +++ b/home.admin/config.scripts/internet.sh @@ -181,9 +181,9 @@ if [ ${runGlobal} -eq 1 ]; then globalIP="" echo "# getting public IP from third party service" if [ "${ipv6}" == "on" ]; then - globalIP=$(curl -s -f -S -m 5 http://v6.ipv6-test.com/api/myip.php 2>/dev/null) + globalIP=$(curl -s -f -S -m 10 http://v6.ipv6-test.com/api/myip.php 2>/dev/null) else - globalIP=$(curl -s -f -S -m 5 http://v4.ipv6-test.com/api/myip.php 2>/dev/null) + globalIP=$(curl -s -f -S -m 10 http://v4.ipv6-test.com/api/myip.php 2>/dev/null) fi echo "## curl returned: ${globalIP}" echo "## curl exit code: ${?}" diff --git a/home.admin/config.scripts/lnd.check.sh b/home.admin/config.scripts/lnd.check.sh index 22f9f2205..cf248b7d3 100755 --- a/home.admin/config.scripts/lnd.check.sh +++ b/home.admin/config.scripts/lnd.check.sh @@ -22,8 +22,7 @@ echo "# lndConfFile(${lndConfFile})" # so it tries to make sure the config is in valid shape ###################################################################### -function setting() # FILE LINENUMBER NAME VALUE -{ +function setting() { # FILE LINENUMBER NAME VALUE FILE=$1 LINENUMBER=$2 NAME=$3 @@ -118,7 +117,6 @@ if [ "$1" == "prestart" ]; then echo "# ${network}.node insert/update" setting ${lndConfFile} ${insertLine} "${network}\.node" "${network}d" - ##### BITCOIND OPTIONS SECTION ##### # [bitcoind] @@ -164,7 +162,7 @@ if [ "$1" == "prestart" ]; then RPCPSW=$(cat /mnt/hdd/${network}/${network}.conf | grep "^${network}d.rpcpassword=" | cut -d "=" -f2 | tail -n 1) fi if [ "${RPCPSW}" == "" ]; then - 1>&2 echo "FAIL: 'rpcpassword' not found in /mnt/hdd/${network}/${network}.conf" + echo 1>&2 "FAIL: 'rpcpassword' not found in /mnt/hdd/${network}/${network}.conf" exit 11 fi setting ${lndConfFile} ${insertLine} "${network}d\.rpcpass" "${RPCPSW}" @@ -175,7 +173,7 @@ if [ "$1" == "prestart" ]; then RPCUSER=$(cat /mnt/hdd/${network}/${network}.conf | grep "^${network}d.rpcuser=" | cut -d "=" -f2 | tail -n 1) fi if [ "${RPCUSER}" == "" ]; then - 1>&2 echo "FAIL: 'rpcuser' not found in /mnt/hdd/${network}/${network}.conf" + echo 1>&2 "FAIL: 'rpcuser' not found in /mnt/hdd/${network}/${network}.conf" exit 12 fi setting ${lndConfFile} ${insertLine} "${network}d\.rpcuser" "${RPCUSER}" @@ -258,7 +256,7 @@ if [ "$1" == "prestart" ]; then # limit workers to the number of cores setting ${lndConfFile} ${insertLine} "workers.write" "${cores}" setting ${lndConfFile} ${insertLine} "workers.sig" "${cores}" -fi + fi ##### TOR SECTION ##### @@ -296,7 +294,7 @@ fi # take care of incompatible settings https://github.com/rootzoll/raspiblitz/issues/2787#issuecomment-991245694 if [ $(cat ${lndConfFile} | grep -c "^tor.skip-proxy-for-clearnet-targets=true") -gt 0 ] || - [ $(cat ${lndConfFile} | grep -c "^tor.skip-proxy-for-clearnet-targets=1") -gt 0 ]; then + [ $(cat ${lndConfFile} | grep -c "^tor.skip-proxy-for-clearnet-targets=1") -gt 0 ]; then setting ${lndConfFile} ${insertLine} "tor.streamisolation" "false" fi @@ -308,7 +306,7 @@ fi ##### RPCMIDDLEWARE SECTION ##### # [rpcmiddleware] - sectionName="[Rr]pcmiddleware" + sectionName="rpcmiddleware" echo "# [${sectionName}] config ..." # make sure lnd config has a [rpcmiddleware] section @@ -337,7 +335,6 @@ fi # SET/UPDATE rpcmiddleware.enable setting ${lndConfFile} ${insertLine} "rpcmiddleware.enable" "true" - echo "# OK PRESTART DONE" ###################################################################### @@ -411,25 +408,25 @@ elif [ "$1" == "basic-setup" ]; then echo "err='$(netprefix)lnd.conf: blockchain network in $(netprefix)lnd.conf (${lndNetwork}) is different from raspiblitz.conf (${network})'" fi -# # get chain from config (TESTNET / MAINNET) -# lndChain="" -# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.mainnet" | sed 's/^[a-z]*\.//g') -# source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.testnet" | sed 's/^[a-z]*\.//g') -# if [ "${mainnet}" == "1" ] && [ "${testnet}" == "1" ]; then -# echo "err='lnd.conf: mainnet and testnet are set active at the same time'" -# elif [ "${mainnet}" == "1" ]; then -# lndChain="main" -# elif [ "${testnet}" == "1" ]; then -# lndChain="test" -# else -# echo "err='lnd.conf: neither testnet or mainnet is set active (raspiblitz needs one of them active in lnd.conf)'" -# fi -# echo "chain='${lndChain}'" -# -# # check if chain is same the raspiblitz config -# if [ "${chain}" != "${lndChain}" ]; then -# echo "err='lnd.conf: testnet/mainnet in lnd.conf (${lndChain}) is different from raspiblitz.conf (${chain})'" -# fi + # # get chain from config (TESTNET / MAINNET) + # lndChain="" + # source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.mainnet" | sed 's/^[a-z]*\.//g') + # source <(sudo cat /mnt/hdd/lnd/lnd.conf 2>/dev/null | grep "${lndNetwork}.testnet" | sed 's/^[a-z]*\.//g') + # if [ "${mainnet}" == "1" ] && [ "${testnet}" == "1" ]; then + # echo "err='lnd.conf: mainnet and testnet are set active at the same time'" + # elif [ "${mainnet}" == "1" ]; then + # lndChain="main" + # elif [ "${testnet}" == "1" ]; then + # lndChain="test" + # else + # echo "err='lnd.conf: neither testnet or mainnet is set active (raspiblitz needs one of them active in lnd.conf)'" + # fi + # echo "chain='${lndChain}'" + # + # # check if chain is same the raspiblitz config + # if [ "${chain}" != "${lndChain}" ]; then + # echo "err='lnd.conf: testnet/mainnet in lnd.conf (${lndChain}) is different from raspiblitz.conf (${chain})'" + # fi # check for admin macaroon exist (on HDD) adminMacaroonExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${chain}net/admin.macaroon 2>/dev/null | grep -c 'admin.macaroon')