mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 20:32:52 +02:00
services: add loop to menu
This commit is contained in:
@@ -7,6 +7,7 @@ source /mnt/hdd/raspiblitz.conf
|
|||||||
|
|
||||||
echo "services default values"
|
echo "services default values"
|
||||||
if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi
|
if [ ${#autoPilot} -eq 0 ]; then autoPilot="off"; fi
|
||||||
|
if [ ${#loop} -eq 0 ]; then loop="off"; fi
|
||||||
if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi
|
if [ ${#autoUnlock} -eq 0 ]; then autoUnlock="off"; fi
|
||||||
if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi
|
if [ ${#runBehindTor} -eq 0 ]; then runBehindTor="off"; fi
|
||||||
if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi
|
if [ ${#rtlWebinterface} -eq 0 ]; then rtlWebinterface="off"; fi
|
||||||
@@ -55,8 +56,9 @@ fi
|
|||||||
echo "run dialog ..."
|
echo "run dialog ..."
|
||||||
|
|
||||||
if [ "${runBehindTor}" = "on" ]; then
|
if [ "${runBehindTor}" = "on" ]; then
|
||||||
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 19 45 11 \
|
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 \
|
||||||
1 'Channel Autopilot' ${autoPilot} \
|
1 'Channel Autopilot' ${autoPilot} \
|
||||||
|
l 'Lightning Loop' ${loop} \
|
||||||
2 'Testnet' ${chainValue} \
|
2 'Testnet' ${chainValue} \
|
||||||
3 ${dynDomainMenu} ${domainValue} \
|
3 ${dynDomainMenu} ${domainValue} \
|
||||||
4 'Run behind TOR' ${runBehindTor} \
|
4 'Run behind TOR' ${runBehindTor} \
|
||||||
@@ -69,8 +71,9 @@ e 'Electrum Rust Server' ${ElectRS} \
|
|||||||
p 'BTCPayServer' ${BTCPayServer} \
|
p 'BTCPayServer' ${BTCPayServer} \
|
||||||
2>&1 >/dev/tty)
|
2>&1 >/dev/tty)
|
||||||
else
|
else
|
||||||
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 20 45 12 \
|
CHOICES=$(dialog --title ' Additional Services ' --checklist ' use spacebar to activate/de-activate ' 21 45 13 \
|
||||||
1 'Channel Autopilot' ${autoPilot} \
|
1 'Channel Autopilot' ${autoPilot} \
|
||||||
|
l 'Lightning Loop' ${loop} \
|
||||||
2 'Testnet' ${chainValue} \
|
2 'Testnet' ${chainValue} \
|
||||||
3 ${dynDomainMenu} ${domainValue} \
|
3 ${dynDomainMenu} ${domainValue} \
|
||||||
4 'Run behind TOR' ${runBehindTor} \
|
4 'Run behind TOR' ${runBehindTor} \
|
||||||
@@ -112,6 +115,18 @@ else
|
|||||||
echo "Autopilot Setting unchanged."
|
echo "Autopilot Setting unchanged."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# LOOP process choice
|
||||||
|
choice="off"; check=$(echo "${CHOICES}" | grep -c "l")
|
||||||
|
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}
|
||||||
|
needsReboot=0
|
||||||
|
else
|
||||||
|
echo "Loop Setting unchanged."
|
||||||
|
fi
|
||||||
|
|
||||||
# TESTNET process choice
|
# TESTNET process choice
|
||||||
choice="main"; check=$(echo "${CHOICES}" | grep -c "2")
|
choice="main"; check=$(echo "${CHOICES}" | grep -c "2")
|
||||||
if [ ${check} -eq 1 ]; then choice="test"; fi
|
if [ ${check} -eq 1 ]; then choice="test"; fi
|
||||||
|
@@ -53,10 +53,10 @@ RestartSec=60
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
" | sudo tee -a /etc/systemd/system/loopd.service
|
" | sudo tee -a /etc/systemd/system/loopd.service
|
||||||
sudo systemctl enable loopd
|
sudo systemctl enable loopd
|
||||||
echo "OK - the the Lightning Loop service is now enabled"
|
echo "OK - the Lightning Loop service is now enabled"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "RTL already installed."
|
echo "Loop service already installed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# start service
|
# start service
|
||||||
@@ -66,6 +66,8 @@ WantedBy=multi-user.target
|
|||||||
# setting value in raspi blitz config
|
# setting value in raspi blitz config
|
||||||
sudo sed -i "s/^loop=.*/loop=on/g" /mnt/hdd/raspiblitz.conf
|
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"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -75,12 +77,12 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
|||||||
# setting value in raspi blitz config
|
# setting value in raspi blitz config
|
||||||
sudo sed -i "s/^loop=.*/loop=off/g" /mnt/hdd/raspiblitz.conf
|
sudo sed -i "s/^loop=.*/loop=off/g" /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
isInstalled=$(sudo ls /etc/systemd/system/loop.service 2>/dev/null | grep -c 'loop.service')
|
isInstalled=$(sudo ls /etc/systemd/system/loopd.service 2>/dev/null | grep -c 'loopd.service')
|
||||||
if [ ${isInstalled} -eq 1 ]; then
|
if [ ${isInstalled} -eq 1 ]; then
|
||||||
echo "*** REMOVING LIGHTNING LOOP SERVICE ***"
|
echo "*** REMOVING LIGHTNING LOOP SERVICE ***"
|
||||||
sudo systemctl stop loop
|
sudo systemctl stop loopd
|
||||||
sudo systemctl disable loop
|
sudo systemctl disable loopd
|
||||||
sudo rm /etc/systemd/system/loop.service
|
sudo rm /etc/systemd/system/loopd.service
|
||||||
sudo rm -rf /home/bitcoin/loop
|
sudo rm -rf /home/bitcoin/loop
|
||||||
echo "OK, the Loop Service is removed."
|
echo "OK, the Loop Service is removed."
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user