diff --git a/home.admin/98installRTL.sh b/home.admin/98installRTL.sh index aad71ddb6..143f64e9d 100644 --- a/home.admin/98installRTL.sh +++ b/home.admin/98installRTL.sh @@ -1,25 +1,66 @@ +#!/bin/sh + +# INSTALLING THE RTL Webinterface from +# https://github.com/ShahanaFarooqui/RTL/blob/master/README.md + +# get the local network IP to be displayed on the lCD +localip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/') + +echo "*** Check if RTL is installed ***" +isInstalled=$(sudo ls /etc/systemd/system/RTL.service | grep -c 'RTL.service') +if [ ${isInstalled} -eq 1 ]; then + echo "!! FAIL - RTL Service is already installed" + echo "if its still not running, check service with:" + echo "sudo systemctl status RTL" + exit 1 +fi + # disable RPC listen # to prevent tls cer auth error +echo "*** Modify lnd.conf ***" sudo sed -i "s/^rpclisten=0.0.0.0:10009/#rpclisten=0.0.0.0:10009/g" /mnt/hdd/lnd/lnd.conf sudo systemctl restart lnd +echo "" # install latest nodejs +echo "*** Install NodeJS ***" curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash - sudo apt-get install -y nodejs +echo "" # close source code +echo "*** Get the RTL Source Code ***" git clone https://github.com/ShahanaFarooqui/RTL.git cd RTL npm install cd .. +echo "" # open firewall +echo "*** Updating Firewall ***" sudo ufw allow 3000 sudo ufw --force enable +echo "" # install service +echo "*** Install RTL as a Boot Service (systemd) ***" sudo cp /home/admin/assets/RTL.service /etc/systemd/system/RTL.service sudo systemctl enable RTL sudo systemctl start RTL +sleep 2 +echo "" -sleep 2 \ No newline at end of file +# install service +echo "*** READY ***" +echo "RTL web servcie should be installed and running now." +echo "" +echo "Try to open the following URL in your local webrowser" +echo "and unlock your wallet from there with PASSWORD C." +echo "---> http://${localip}:3000" +echo "" +echo "RTL web server will now start with every new boot." +echo "Always unlock your wallet from there now." +echo "Just use RTL from same local network, dont forward" +echo "port 3000 on your internet router to the RaspiBlitz." +echo "" +echo "Have fun 'Riding the Lightning' (RTL) :D" \ No newline at end of file diff --git a/home.admin/assets/RTL.service b/home.admin/assets/RTL.service index bf4a224a2..226487007 100644 --- a/home.admin/assets/RTL.service +++ b/home.admin/assets/RTL.service @@ -7,7 +7,7 @@ Wants=lnd.service After=lnd.service [Service] -/usr/bin/node /home/admin/RTL/rtl --lndir /home/admin/.lnd/data/chain/bitcoin/mainnet +ExecStart=/usr/bin/node /home/admin/RTL/rtl --lndir /home/admin/.lnd/data/chain/bitcoin/mainnet User=root Restart=always TimeoutSec=120