From d5eb39e533f84bb7f9554e1d91aa5289c9130056 Mon Sep 17 00:00:00 2001 From: openoms Date: Tue, 17 Dec 2019 19:28:03 +0000 Subject: [PATCH 1/2] services: show info only on installation --- home.admin/00settingsMenuServices.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 1dee292c6..6008894e3 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -125,10 +125,12 @@ if [ "${loop}" != "${choice}" ]; then echo "Loop Setting changed .." anychange=1 sudo /home/admin/config.scripts/bonus.loop.sh ${choice} - whiptail --title " Installed the Lightning Loop Service (loopd) " --msgbox "\ + if [ "${choice}" = "on" ]; then + whiptail --title " Installed the Lightning Loop Service (loopd) " --msgbox "\ Usage and examples: https://github.com/lightninglabs/loop#loop-out-swaps\n Start from the command line by typing 'loop' to see the options. -" 10 75 +" 10 75 + fi needsReboot=0 else echo "Loop Setting unchanged." @@ -524,12 +526,14 @@ if [ "${lndmanage}" != "${choice}" ]; then echo "lndmanage Setting changed .." anychange=1 sudo /home/admin/config.scripts/bonus.lndmanage.sh ${choice} - whiptail --title " Installed lndmanage " --msgbox "\ + if [ "${choice}" = "on" ]; then + whiptail --title " Installed lndmanage " --msgbox "\ Usage: https://github.com/bitromortac/lndmanage/blob/master/README.md\n Start with the line: 'cd lndmanage & source venv/bin/activate & lndmanage'\n To exit: type 'deactivate' and press ENTER -" 12 75 +" 12 75 + fi needsReboot=0 else echo "lndmanage setting unchanged." From 61e532eccb4c9b2a18d6c7cb2c28689728fd7a3f Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 18 Dec 2019 12:26:49 +0000 Subject: [PATCH 2/2] recover services on bootstrap --- home.admin/20recoverDialog.sh | 9 ++++++ home.admin/_bootstrap.provision.sh | 49 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/home.admin/20recoverDialog.sh b/home.admin/20recoverDialog.sh index add27e293..9e47ac557 100755 --- a/home.admin/20recoverDialog.sh +++ b/home.admin/20recoverDialog.sh @@ -31,6 +31,15 @@ sudo systemctl enable ${network}d.service if [ "${rtlWebinterface}" = "on" ]; then sudo systemctl enable RTL fi +if [ "${loop}" = "on" ]; then + sudo systemctl enable loopd +fi +if [ "${BTCRPCexplorer}" = "on" ]; then + sudo systemctl enable btc-rpc-explorer +fi +if [ "${ElectRS}" = "on" ]; then + sudo systemctl enable electrs +fi # remove flag that freshly recovered sudo rm /home/admin/raspiblitz.recover.info diff --git a/home.admin/_bootstrap.provision.sh b/home.admin/_bootstrap.provision.sh index e3e82aac3..cf80bb4f6 100644 --- a/home.admin/_bootstrap.provision.sh +++ b/home.admin/_bootstrap.provision.sh @@ -170,6 +170,53 @@ else echo "Provisioning RTL - keep default" >> ${logFile} fi +#LOOP +if [ "${loop}" = "on" ]; then + echo "Provisioning Lightning Loop - run config script" >> ${logFile} + sudo sed -i "s/^message=.*/message='Setup Lightning Loop'/g" ${infoFile} + /home/admin/config.scripts/bonus.loop.sh on >> ${logFile} 2>&1 + sudo systemctl disable loopd # will get enabled after recover dialog +else + echo "Provisioning Lightning Loop - keep default" >> ${logFile} +fi + +#BTC RPC EXPLORER +if [ "${BTCRPCexplorer}" = "on" ]; then + echo "Provisioning BTCRPCexplorer - run config script" >> ${logFile} + sudo sed -i "s/^message=.*/message='Setup BTCRPCexplorer (takes time)'/g" ${infoFile} + /home/admin/config.scripts/bonus.btc-rpc-explorer.sh on >> ${logFile} 2>&1 + sudo systemctl disable btc-rpc-explorer # will get enabled after recover dialog +else + echo "Provisioning BTCRPCexplorer - keep default" >> ${logFile} +fi + +#ELECTRS +if [ "${ElectRS}" = "on" ]; then + echo "Provisioning ElectRS - run config script" >> ${logFile} + sudo sed -i "s/^message=.*/message='Setup ElectRS (takes time)'/g" ${infoFile} + /home/admin/config.scripts/bonus.electrs.sh on >> ${logFile} 2>&1 + sudo systemctl disable electrs # will get enabled after recover dialog +else + echo "Provisioning ElectRS - keep default" >> ${logFile} +fi + +# BTCPAYSERVER - not restored due to need for domain name and port forwarding +if [ "${BTCPayServer}" = "on" ]; then + echo "Setting BTCPayServer to be off - will need to be reinstalled from the menu again" >> ${logFile} + sudo sed -i "s/^BTCPayServer=.*/BTCPayServer=off/g" /mnt/hdd/raspiblitz.conf +else + echo "Provisioning BTCPayServer - keep default" >> ${logFile} +fi + +# LNDMANAGE +if [ "${lndmanage}" = "on" ]; then + echo "Provisioning lndmanage - run config script" >> ${logFile} + sudo sed -i "s/^message=.*/message='Setup lndmanage '/g" ${infoFile} + /home/admin/config.scripts/bonus.lndmanage.sh on >> ${logFile} 2>&1 +else + echo "Provisioning ElectRS - keep default" >> ${logFile} +fi + # CUSTOM PORT echo "Provisioning LND Port" >> ${logFile} if [ ${#lndPort} -eq 0 ]; then @@ -241,6 +288,8 @@ else echo "Provisioning UPS - not active" >> ${logFile} fi + + # replay backup LND conf & tlscerts # https://github.com/rootzoll/raspiblitz/issues/324 echo "" >> ${logFile}