loop: remove sudo, add message if fails to install

This commit is contained in:
openoms 2019-12-18 15:50:36 +00:00
parent ef5a21137e
commit 2aa25e545f
No known key found for this signature in database
GPG key ID: A8133C3CF50B44E3
3 changed files with 24 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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