From 9337d17665638a1ba89d1c10e7a8a98617ec8226 Mon Sep 17 00:00:00 2001 From: openoms Date: Tue, 17 Dec 2019 17:14:09 +0000 Subject: [PATCH 1/2] bootsrap: fix RTL reinstallation --- home.admin/_bootstrap.provision.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home.admin/_bootstrap.provision.sh b/home.admin/_bootstrap.provision.sh index e3e82aac3..98c8dc8d7 100644 --- a/home.admin/_bootstrap.provision.sh +++ b/home.admin/_bootstrap.provision.sh @@ -164,7 +164,7 @@ fi if [ "${rtlWebinterface}" = "on" ]; then echo "Provisioning RTL - run config script" >> ${logFile} sudo sed -i "s/^message=.*/message='Setup RTL (takes time)'/g" ${infoFile} - sudo /home/admin/config.scripts/bonus.rtl.sh on >> ${logFile} 2>&1 + /home/admin/config.scripts/bonus.rtl.sh on >> ${logFile} 2>&1 sudo systemctl disable RTL # will get enabled after recover dialog else echo "Provisioning RTL - keep default" >> ${logFile} From 2aa25e545fcb115eef8f9476d3f69530f866b978 Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 18 Dec 2019 15:50:36 +0000 Subject: [PATCH 2/2] loop: remove sudo, add message if fails to install --- home.admin/00settingsMenuServices.sh | 12 ++++++++++-- home.admin/config.scripts/bonus.go.sh | 5 +++++ home.admin/config.scripts/bonus.loop.sh | 12 +++++++++--- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/home.admin/00settingsMenuServices.sh b/home.admin/00settingsMenuServices.sh index 6008894e3..b0cd1c1fa 100644 --- a/home.admin/00settingsMenuServices.sh +++ b/home.admin/00settingsMenuServices.sh @@ -124,12 +124,20 @@ if [ ${check} -eq 1 ]; then choice="on"; fi if [ "${loop}" != "${choice}" ]; then echo "Loop Setting changed .." anychange=1 - sudo /home/admin/config.scripts/bonus.loop.sh ${choice} + /home/admin/config.scripts/bonus.loop.sh ${choice} + errorOnInstall=$? if [ "${choice}" = "on" ]; then - whiptail --title " Installed the Lightning Loop Service (loopd) " --msgbox "\ + if [ ${errorOnInstall} -eq 0 ]; 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 + else + l1="FAILED to install Lightning LOOP" + l2="Try manual install in the terminal with:" + l3="/home/admin/config.scripts/bonus.loop.sh on" + dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 7 65 + fi fi needsReboot=0 else diff --git a/home.admin/config.scripts/bonus.go.sh b/home.admin/config.scripts/bonus.go.sh index a59994448..4265f82c7 100755 --- a/home.admin/config.scripts/bonus.go.sh +++ b/home.admin/config.scripts/bonus.go.sh @@ -10,6 +10,10 @@ isX86_64=$(uname -m | grep -c 'x86_64') isX86_32=$(uname -m | grep -c 'i386\|i486\|i586\|i686\|i786') # make sure go is installed + +# get Go vars - needed if there was no log-out since Go installed +source /etc/profile + echo "Check Framework: Go" goInstalled=$(go version 2>/dev/null | grep -c 'go') if [ ${goInstalled} -eq 0 ];then @@ -29,6 +33,7 @@ if [ ${goInstalled} -eq 0 ];then echo "*** Installing Go v${goVersion} for ${goOSversion} ***" # wget https://storage.googleapis.com/golang/go${goVersion}.linux-${goOSversion}.tar.gz + sudo rm *.gz wget https://dl.google.com/go/go${goVersion}.linux-${goOSversion}.tar.gz if [ ! -f "./go${goVersion}.linux-${goOSversion}.tar.gz" ] then diff --git a/home.admin/config.scripts/bonus.loop.sh b/home.admin/config.scripts/bonus.loop.sh index 3d311f56b..5045fc3ef 100644 --- a/home.admin/config.scripts/bonus.loop.sh +++ b/home.admin/config.scripts/bonus.loop.sh @@ -68,9 +68,15 @@ WantedBy=multi-user.target # setting value in raspi blitz config sudo sed -i "s/^loop=.*/loop=on/g" /mnt/hdd/raspiblitz.conf - - echo "Find info on how to use on https://github.com/lightninglabs/loop#loop-out-swaps" - + + isInstalled=$(loop | grep -c loop) + if [ ${isInstalled} -gt 0 ] ; then + echo "Find info on how to use on https://github.com/lightninglabs/loop#loop-out-swaps" + else + echo " Failed to install Lightning Loop " + exit 1 + fi + exit 0 fi