mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-27 03:56:21 +02:00
#322 install checks on RTL
This commit is contained in:
@@ -172,13 +172,21 @@ if [ "${rtlWebinterface}" != "${choice}" ]; then
|
|||||||
echo "RTL Webinterface Setting changed .."
|
echo "RTL Webinterface Setting changed .."
|
||||||
anychange=1
|
anychange=1
|
||||||
sudo /home/admin/config.scripts/bonus.rtl.sh ${choice}
|
sudo /home/admin/config.scripts/bonus.rtl.sh ${choice}
|
||||||
|
errorOnInstall=$?
|
||||||
if [ "${choice}" = "on" ]; then
|
if [ "${choice}" = "on" ]; then
|
||||||
|
if [ ${errorOnInstall} -eq 0 ]; then
|
||||||
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
||||||
l1="RTL web servcie will be ready AFTER NEXT REBOOT:"
|
l1="RTL web servcie will be ready AFTER NEXT REBOOT:"
|
||||||
l2="Try to open the following URL in your local webrowser"
|
l2="Try to open the following URL in your local webrowser"
|
||||||
l3="and login with your PASSWORD B."
|
l3="and login with your PASSWORD B."
|
||||||
l4="---> http://${localip}:3000"
|
l4="---> http://${localip}:3000"
|
||||||
dialog --title 'OK' --msgbox "${l1}\n${l2}\n${l3}\n${l4}" 11 65
|
dialog --title 'OK' --msgbox "${l1}\n${l2}\n${l3}\n${l4}" 11 65
|
||||||
|
else
|
||||||
|
l1="!!! FAIL on RTL install !!!"
|
||||||
|
l2="Try manual install on terminal after rebootwith:"
|
||||||
|
l3="sudo /home/admin/config.scripts/bonus.rtl.sh on"
|
||||||
|
dialog --title 'FAIL' --msgbox "${l1}\n${l2}\n${l3}" 10 65
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
needsReboot=1
|
needsReboot=1
|
||||||
else
|
else
|
||||||
|
@@ -29,9 +29,6 @@ sudo systemctl stop RTL 2>/dev/null
|
|||||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
echo "*** INSTALL RTL ***"
|
echo "*** INSTALL RTL ***"
|
||||||
|
|
||||||
# setting value in raspi blitz config
|
|
||||||
sudo sed -i "s/^rtlWebinterface=.*/rtlWebinterface=on/g" /mnt/hdd/raspiblitz.conf
|
|
||||||
|
|
||||||
isInstalled=$(sudo ls /etc/systemd/system/RTL.service 2>/dev/null | grep -c 'RTL.service')
|
isInstalled=$(sudo ls /etc/systemd/system/RTL.service 2>/dev/null | grep -c 'RTL.service')
|
||||||
if [ ${isInstalled} -eq 0 ]; then
|
if [ ${isInstalled} -eq 0 ]; then
|
||||||
|
|
||||||
@@ -42,18 +39,42 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||||||
sudo apt-get install -y nodejs
|
sudo apt-get install -y nodejs
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
# check if nodeJS was installed
|
||||||
|
nodeJSInstalled=$(node -v | grep -c "v11.")
|
||||||
|
if [ nodeJSInstalled -eq 0 ]; then
|
||||||
|
echo "FAIL - Was not able to install nodeJS 11"
|
||||||
|
echo "ABORT - RTL install"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# download source code and set to tag release
|
# download source code and set to tag release
|
||||||
echo "*** Get the RTL Source Code ***"
|
echo "*** Get the RTL Source Code ***"
|
||||||
git clone https://github.com/ShahanaFarooqui/RTL.git
|
git clone https://github.com/ShahanaFarooqui/RTL.git
|
||||||
cd RTL
|
cd RTL
|
||||||
git reset --hard v0.2.1
|
git reset --hard v0.2.15
|
||||||
#git reset --hard v0.1.14-alpha
|
# check if node_modles exists now
|
||||||
|
if [ -d "/home/admin/RTL" ]; then
|
||||||
|
echo "OK - RTL code copy looks good"
|
||||||
|
else
|
||||||
|
echo "FAIL - code copy did not run correctly"
|
||||||
|
echo "ABORT - RTL install"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
|
||||||
# install
|
# install
|
||||||
echo "*** Run: npm install ***"
|
echo "*** Run: npm install ***"
|
||||||
npm install
|
npm install
|
||||||
cd ..
|
cd ..
|
||||||
|
# check if node_modles exists now
|
||||||
|
if [ -d "/home/admin/RTL/node_modules" ]; then
|
||||||
|
echo "OK - RTL install looks good"
|
||||||
|
else
|
||||||
|
echo "FAIL - npm install did not run correctly"
|
||||||
|
echo "ABORT - RTL install"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# prepare RTL.conf file
|
# prepare RTL.conf file
|
||||||
@@ -77,10 +98,14 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||||||
sudo sed -i "s|chain/bitcoin/mainnet|chain/${network}/${chain}net|" /etc/systemd/system/RTL.service
|
sudo sed -i "s|chain/bitcoin/mainnet|chain/${network}/${chain}net|" /etc/systemd/system/RTL.service
|
||||||
sudo systemctl enable RTL
|
sudo systemctl enable RTL
|
||||||
echo "OK - RTL is now ACTIVE"
|
echo "OK - RTL is now ACTIVE"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "RTL already installed."
|
echo "RTL already installed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# setting value in raspi blitz config
|
||||||
|
sudo sed -i "s/^rtlWebinterface=.*/rtlWebinterface=on/g" /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
echo "needs reboot to activate new setting"
|
echo "needs reboot to activate new setting"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user