Merge pull request #931 from openoms/v1.4patch-3

Fix bootstrap.provision when all services are on
This commit is contained in:
Christian Rotzoll 2019-12-25 12:36:29 +01:00 committed by GitHub
commit 8d8e4d0e10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 28 additions and 33 deletions

View File

@ -128,18 +128,20 @@ if [ "${loop}" != "${choice}" ]; then
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
# add Go vars to current session
sudo systemctl start loopd
if [ ${#GOPATH} -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 a new terminal session (log in again with ssh) and
start from the command line by typing 'loop' to see the options.
" 11 75
Start from the command line after the reboot.
Use the command 'loop' to see the options.
" 11 56
needsReboot=1
else
whiptail --title " Installed the Lightning Loop Service (loopd) " --msgbox "\
Usage and examples: https://github.com/lightninglabs/loop#loop-out-swaps\n
Use can use command 'loop' to see the options.
" 10 75
Use the command 'loop' to see the options.
" 10 56
needsReboot=0
fi
else
l1="FAILED to install Lightning LOOP"
@ -319,6 +321,7 @@ if [ "${rtlWebinterface}" != "${choice}" ]; then
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
sudo systemctl start RTL
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
if [ "${runBehindTor}" = "on" ]; then
TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/RTL/hostname)
@ -356,6 +359,7 @@ if [ "${BTCRPCexplorer}" != "${choice}" ]; then
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
sudo sytemctl start btc-rpc-explorer
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
if [ "${runBehindTor}" = "on" ]; then
TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/btc-rpc-explorer/hostname)
@ -443,6 +447,7 @@ if [ "${ElectRS}" != "${choice}" ]; then
errorOnInstall=$?
if [ "${choice}" = "on" ]; then
if [ ${errorOnInstall} -eq 0 ]; then
sudo systemctl start electrs
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
if [ "${runBehindTor}" = "on" ]; then
TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/electrs/hostname)

View File

@ -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}
/home/admin/config.scripts/bonus.rtl.sh on >> ${logFile} 2>&1
sudo -u admin /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}
@ -174,7 +174,7 @@ fi
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 -u admin /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}
@ -184,7 +184,7 @@ fi
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 -u admin /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}
@ -194,7 +194,7 @@ fi
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 -u admin /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}
@ -212,7 +212,7 @@ fi
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
sudo -u admin /home/admin/config.scripts/bonus.lndmanage.sh on >> ${logFile} 2>&1
else
echo "Provisioning ElectRS - keep default" >> ${logFile}
fi

View File

@ -156,10 +156,6 @@ EOF
echo "BTC-RPC-explorer already installed."
fi
# start service
echo "Starting service"
sudo systemctl start btc-rpc-explorer 2>/dev/null
# setting value in raspi blitz config
sudo sed -i "s/^BTCRPCexplorer=.*/BTCRPCexplorer=on/g" /mnt/hdd/raspiblitz.conf
@ -167,7 +163,8 @@ EOF
echo "monitor with: sudo tail -n 20 -f /mnt/hdd/bitcoin/debug.log"
## Enable BTCEXP_ADDRESS_API if BTC-RPC-Explorer is active
/home/admin/config.scripts/bonus.electrsexplorer.sh
# see /home/admin/config.scripts/bonus.electrsexplorer.sh
# run every 10 min by _background.sh
# Hidden Service for BTC-RPC-explorer if Tor is active
source /mnt/hdd/raspiblitz.conf

View File

@ -266,7 +266,6 @@ RestartSec=60
WantedBy=multi-user.target
" | sudo tee -a /etc/systemd/system/electrs.service
sudo systemctl enable electrs
sudo systemctl start electrs
# manual start:
# sudo -u electrs /home/electrs/.cargo/bin/cargo run --release -- --index-batch-size=10 --electrum-rpc-addr="0.0.0.0:50001"
echo ""
@ -277,9 +276,6 @@ WantedBy=multi-user.target
else
echo "ElectRS is already installed."
# start service
echo "start service"
sudo systemctl start electrs 2>/dev/null
fi
# setting value in raspiblitz config
@ -311,7 +307,8 @@ WantedBy=multi-user.target
fi
## Enable BTCEXP_ADDRESS_API if BTC-RPC-Explorer is active
/home/admin/config.scripts/bonus.electrsexplorer.sh
# see /home/admin/config.scripts/bonus.electrsexplorer.sh
# run every 10 min by _background.sh
echo ""
echo "To connect through SSL from outside of the local network make sure the port 50002 is forwarded on the router"
@ -348,7 +345,7 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
echo "OK ElectRS removed."
## Disable BTCEXP_ADDRESS_API if BTC-RPC-Explorer is active
/home/admin/config.scripts/bonus.electrsexplorer.sh off
/home/admin/config.scripts/bonus.electrsexplorer.sh
else
echo "ElectRS is not installed."
fi

View File

@ -33,15 +33,16 @@ 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
cd /home/admin/download
wget https://dl.google.com/go/go${goVersion}.linux-${goOSversion}.tar.gz
if [ ! -f "./go${goVersion}.linux-${goOSversion}.tar.gz" ]
then
echo "!!! FAIL !!! Download not success."
rm -f go${goVersion}.linux-${goOSversion}.tar.gz*
exit 1
fi
sudo tar -C /usr/local -xzf go${goVersion}.linux-${goOSversion}.tar.gz
sudo rm *.gz
rm -f go${goVersion}.linux-${goOSversion}.tar.gz*
sudo mkdir /usr/local/gocode
sudo chmod 777 /usr/local/gocode
export GOROOT=/usr/local/go

View File

@ -63,10 +63,6 @@ WantedBy=multi-user.target
else
echo "Loop service already installed."
fi
# start service
echo "Starting service"
sudo systemctl start loopd 2>/dev/null
# setting value in raspi blitz config
sudo sed -i "s/^loop=.*/loop=on/g" /mnt/hdd/raspiblitz.conf

View File

@ -57,11 +57,13 @@ if [ ${nodeJSInstalled} -eq 0 ]; then
echo "*** Install NodeJS $VERSION-$DISTRO ***"
# download
cd /home/admin/download
wget https://nodejs.org/dist/$VERSION/node-$VERSION-$DISTRO.tar.xz
# checksum
isChecksumValid=$(sha256sum node-$VERSION-$DISTRO.tar.xz | grep -c "${CHECKSUM}")
if [ ${isChecksumValid} -eq 0 ]; then
echo "FAIL: The checksum of node-$VERSION-$DISTRO.tar.xz is NOT ${CHECKSUM}"
rm -f node-$VERSION-$DISTRO.tar.xz*
exit 1
fi
echo "OK CHECKSUM of nodeJS is OK"
@ -69,7 +71,8 @@ if [ ${nodeJSInstalled} -eq 0 ]; then
# install
sudo mkdir -p /usr/local/lib/nodejs
sudo tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs
sudo tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs
rm -f node-$VERSION-$DISTRO.tar.xz*
export PATH=/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:$PATH
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/node /usr/bin/node
sudo ln -s /usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin/npm /usr/bin/npm

View File

@ -93,10 +93,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "RTL already installed."
fi
# start service
echo "Starting service"
sudo systemctl start RTL 2>/dev/null
# setting value in raspi blitz config
sudo sed -i "s/^rtlWebinterface=.*/rtlWebinterface=on/g" /mnt/hdd/raspiblitz.conf