mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-13 03:30:49 +02:00
Reduced Options ParallelMenu
This commit is contained in:
parent
9beda86434
commit
45fd101836
@ -133,13 +133,16 @@ fi
|
|||||||
if [ "${circuitbreaker}" == "on" ]; then
|
if [ "${circuitbreaker}" == "on" ]; then
|
||||||
OPTIONS+=(CIRCUIT "Circuitbreaker (LND firewall)")
|
OPTIONS+=(CIRCUIT "Circuitbreaker (LND firewall)")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${testnet}" == "on" ]; then
|
if [ "${testnet}" == "on" ]; then
|
||||||
OPTIONS+=(TESTNET "Testnet Service Options")
|
OPTIONS+=(TESTNETS "Testnet/Signet Options")
|
||||||
fi
|
|
||||||
if [ ${chain} != "main" ]; then
|
|
||||||
OPTIONS+=(MAINNET "Mainnet Service Options")
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# dont offer to switch to "testnet view for now" - so no wswitch back to mainnet needed
|
||||||
|
#if [ ${chain} != "main" ]; then
|
||||||
|
# OPTIONS+=(MAINNET "Mainnet Service Options")
|
||||||
|
#fi
|
||||||
|
|
||||||
# Basic Options
|
# Basic Options
|
||||||
OPTIONS+=(INFO "RaspiBlitz Status Screen")
|
OPTIONS+=(INFO "RaspiBlitz Status Screen")
|
||||||
|
|
||||||
@ -290,12 +293,9 @@ case $CHOICE in
|
|||||||
CIRCUIT)
|
CIRCUIT)
|
||||||
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh menu
|
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh menu
|
||||||
;;
|
;;
|
||||||
TESTNET)
|
TESTNETS)
|
||||||
/home/admin/00parallelChainsMenu.sh testnet
|
/home/admin/00parallelChainsMenu.sh
|
||||||
;;
|
;;
|
||||||
MAINNET)
|
|
||||||
/home/admin/00parallelChainsMenu.sh mainnet
|
|
||||||
;;
|
|
||||||
SUBSCRIBE)
|
SUBSCRIBE)
|
||||||
/home/admin/config.scripts/blitz.subscriptions.py
|
/home/admin/config.scripts/blitz.subscriptions.py
|
||||||
;;
|
;;
|
||||||
|
@ -1,97 +1,39 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Usage:
|
# For now just list all testnet/signet options available
|
||||||
# 00parallelChainsMenu.sh <testnet|signet|mainnet> <lnd|cln>
|
# injecting specific perspectives can be done later
|
||||||
|
|
||||||
source /home/admin/raspiblitz.info
|
source /home/admin/raspiblitz.info
|
||||||
# add default value to raspi config if needed
|
|
||||||
if ! grep -Eq "^testnet=" /mnt/hdd/raspiblitz.conf; then
|
|
||||||
echo "testnet=off" >> /mnt/hdd/raspiblitz.conf
|
|
||||||
fi
|
|
||||||
if ! grep -Eq "^lightning=" /mnt/hdd/raspiblitz.conf; then
|
|
||||||
echo "lightning=lnd" >> /mnt/hdd/raspiblitz.conf
|
|
||||||
fi
|
|
||||||
source /mnt/hdd/raspiblitz.conf
|
source /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
# CHAIN is signet | testnet | mainnet
|
|
||||||
if [ $# -gt 0 ]; then
|
|
||||||
CHAIN=$1
|
|
||||||
if [ $1 != ${chain}net ];then
|
|
||||||
nonDefaultChain=1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
nonDefaultChain=0
|
|
||||||
CHAIN=${chain}net
|
|
||||||
fi
|
|
||||||
|
|
||||||
# LNTYPE is lnd | cln
|
|
||||||
if [ $# -gt 1 ]&&[ $2 != $lightning ];then
|
|
||||||
nonDefaultLNtype=1
|
|
||||||
LNTYPE=$2
|
|
||||||
else
|
|
||||||
nonDefaultLNtype=0
|
|
||||||
LNTYPE=$lightning
|
|
||||||
fi
|
|
||||||
|
|
||||||
# get the local network IP to be displayed on the LCD
|
# get the local network IP to be displayed on the LCD
|
||||||
source <(/home/admin/config.scripts/internet.sh status local)
|
source <(/home/admin/config.scripts/internet.sh status local)
|
||||||
|
|
||||||
# BASIC MENU INFO
|
# BASIC MENU INFO
|
||||||
WIDTH=64
|
WIDTH=64
|
||||||
BACKTITLE="${CHAIN} options"
|
BACKTITLE="RaspiBlitz"
|
||||||
TITLE=""
|
TITLE=" Testnet/Signet Options "
|
||||||
MENU="Choose one of the following options:"
|
MENU="Choose one of the following options:"
|
||||||
OPTIONS=()
|
OPTIONS=()
|
||||||
plus=""
|
plus=""
|
||||||
|
|
||||||
if [ "${runBehindTor}" = "on" ]; then
|
if [ "${testnet}" == "on" ]; then
|
||||||
plus=" / TOR"
|
OPTIONS+=(tSYS "TESTNET Monitoring & Configuration")
|
||||||
fi
|
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then OPTIONS+=(tLND "TESTNET LND Wallet Options"); fi
|
||||||
if [ ${#dynDomain} -gt 0 ]; then
|
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then OPTIONS+=(tCLN "TESTNET C-Lightning Wallet Options"); fi
|
||||||
plus="${plus} / ${dynDomain}"
|
|
||||||
fi
|
|
||||||
BACKTITLE="${localip} / ${hostname} / ${network} / ${chain}${plus}"
|
|
||||||
|
|
||||||
# Put Activated Apps on top
|
|
||||||
if [ $chain = test ]&&[ "$trtlWebinterface" = "on" ]||\
|
|
||||||
[ $chain = sig ]&& [ "$srtlWebinterface" = "on" ]||\
|
|
||||||
[ $chain = main ]&&[ "$rtlWebinterface" = "on" ]; then
|
|
||||||
OPTIONS+=(RTL "RTL Web Node Manager for LND ${CHAIN}")
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $chain = test ]&&[ "$tlnd" = "on" ]||\
|
if [ "${signet}" == "on" ]; then
|
||||||
[ $chain = sig ]&& [ "$slnd" = "on" ]||\
|
OPTIONS+=(sSYS "SIGNET Monitoring & Configuration")
|
||||||
[ $chain = main ]&&[ "$lnd" = "on" ]; then
|
if [ "${lightning}" == "cln" ] || [ "${cln}" == "on" ]; then OPTIONS+=(sCLN "SIGNET C-Lightning Wallet Options"); fi
|
||||||
OPTIONS+=(LND "LND options for ${CHAIN}")
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$chain" = "test" ]&&[ "$tcrtlWebinterface" = "on" ]||\
|
# DONT OFFER SERVICES FOR TESTNET RIGHT NOW
|
||||||
[ "$chain" = "sig" ]&& [ "$scrtlWebinterface" = "on" ]||\
|
# OPTIONS+=(RTL "RTL Web Node Manager for LND ${CHAIN}")
|
||||||
[ "$chain" = "main" ]&&[ "$crtlWebinterface" = "on" ]; then
|
# OPTIONS+=(SERVICES "Additional Apps & Services on ${CHAIN}")
|
||||||
OPTIONS+=(cRTL "RTL Web Node Manager for C-lightning ${CHAIN}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$chain" = "test" ]&&[ "$tcln" = "on" ]||\
|
# MAYBE LATER
|
||||||
[ "$chain" = "sig" ]&& [ "$scln" = "on" ]||\
|
# OPTIONS+=(CONNECT "Connect Apps & Show Credentials")
|
||||||
[ "$chain" = "main" ]&&[ "$cln" = "on" ]; then
|
|
||||||
OPTIONS+=(CLN "C-lightning options for ${CHAIN}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
OPTIONS+=(INFO "RaspiBlitz Status Screen for ${CHAIN}")
|
|
||||||
|
|
||||||
if [ "$testnet" == "on" ]; then
|
|
||||||
OPTIONS+=(SERVICES "Additional Apps & Services on ${CHAIN}")
|
|
||||||
fi
|
|
||||||
OPTIONS+=(SYSTEM "Monitoring & Configuration")
|
|
||||||
#TODO OPTIONS+=(CONNECT "Connect Apps & Show Credentials")
|
|
||||||
|
|
||||||
if [ $nonDefaultLNtype = 1 ];then
|
|
||||||
OPTIONS+=(SWITCHLN "Make ${LNTYPE} the default lightning wallet")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $nonDefaultChain = 1 ];then
|
|
||||||
OPTIONS+=(MKDEFAULT "Make ${CHAIN} the default chain")
|
|
||||||
fi
|
|
||||||
|
|
||||||
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
|
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
|
||||||
HEIGHT=$((CHOICE_HEIGHT+6))
|
HEIGHT=$((CHOICE_HEIGHT+6))
|
||||||
@ -106,73 +48,22 @@ CHOICE=$(dialog --clear \
|
|||||||
2>&1 >/dev/tty)
|
2>&1 >/dev/tty)
|
||||||
|
|
||||||
case $CHOICE in
|
case $CHOICE in
|
||||||
INFO)
|
tSYS)
|
||||||
echo "Gathering Information (please wait) ..."
|
/home/admin/99systemMenu.sh testnet
|
||||||
while :
|
|
||||||
do
|
|
||||||
|
|
||||||
# show the same info as on LCD screen
|
|
||||||
/home/admin/00infoBlitz.sh ${lightning} ${chain}net
|
|
||||||
|
|
||||||
# wait 6 seconds for user exiting loop
|
|
||||||
echo ""
|
|
||||||
echo -en "Screen is updating in a loop .... press 'x' now to get back to menu."
|
|
||||||
read -n 1 -t 6 keyPressed
|
|
||||||
echo -en "\rGathering information to update info ... please wait. \n"
|
|
||||||
|
|
||||||
# check if user wants to abort session
|
|
||||||
if [ "${keyPressed}" = "x" ]; then
|
|
||||||
echo ""
|
|
||||||
echo "Returning to menu ....."
|
|
||||||
sleep 4
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
RTL)
|
|
||||||
/home/admin/config.scripts/bonus.rtl.sh menu lnd $CHAIN
|
|
||||||
;;
|
;;
|
||||||
cRTL)
|
sSYS)
|
||||||
/home/admin/config.scripts/bonus.rtl.sh menu cln $CHAIN
|
/home/admin/99systemMenu.sh signet
|
||||||
;;
|
;;
|
||||||
LND)
|
tLND)
|
||||||
/home/admin/99lndMenu.sh $CHAIN
|
/home/admin/99lndMenu.sh testnet
|
||||||
;;
|
;;
|
||||||
CLN)
|
sLND)
|
||||||
/home/admin/99clnMenu.sh $CHAIN
|
/home/admin/99lndMenu.sh signet
|
||||||
;;
|
;;
|
||||||
SERVICES)
|
tCLN)
|
||||||
if [ $CHAIN = testnet ];then
|
/home/admin/99clnMenu.sh testnet
|
||||||
/home/admin/00parallelTestnetServices.sh
|
|
||||||
elif [ $CHAIN = mainnet ];then
|
|
||||||
/home/admin/00parallelMainnetServices.sh $CHAIN
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
SYSTEM)
|
sCLN)
|
||||||
/home/admin/99systemMenu.sh $CHAIN
|
/home/admin/99clnMenu.sh signet
|
||||||
;;
|
|
||||||
CONNECT)
|
|
||||||
/home/admin/99connectMenu.sh $CHAIN
|
|
||||||
;;
|
|
||||||
SWITCHLN)
|
|
||||||
# setting value in raspi blitz config
|
|
||||||
sudo sed -i "s/^lightning=.*/lightning=$LNTYPE/g" /mnt/hdd/raspiblitz.conf
|
|
||||||
echo "# OK - Set lightning=$LNTYPE in /mnt/hdd/raspiblitz.conf"
|
|
||||||
echo
|
|
||||||
echo "Press ENTER to return to main menu."
|
|
||||||
;;
|
|
||||||
MKDEFAULT)
|
|
||||||
# setting value in raspi blitz config
|
|
||||||
newchain=${CHAIN::-3}
|
|
||||||
sudo sed -i "s/^chain=.*/chain=${newchain}/g" /mnt/hdd/raspiblitz.conf
|
|
||||||
echo "# OK - Set chain=${newchain} in /mnt/hdd/raspiblitz.conf"
|
|
||||||
sudo /home/admin/config.scripts/lnd.credentials.sh sync
|
|
||||||
if grep -Eq "^specter=on" /mnt/hdd/raspiblitz.conf; then
|
|
||||||
echo "# Restart Specter on $CHAIN"
|
|
||||||
sudo systemctl restart specter.service
|
|
||||||
fi
|
|
||||||
echo
|
|
||||||
echo "Press ENTER to return to main menu."
|
|
||||||
read key
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
Loading…
Reference in New Issue
Block a user