raspiblitz/home.admin/00mainMenu.sh
/rootzoll 1a0c4fe09a
v1.9.0rc3 Merge (#3742)
* cln: use default normal feerate to withdraw all

* Bugfix: bad subsititution (#3668)

Fix for error:

/home/admin/config.scripts/bonus.go.sh: line 31: ${goOSversion{}: bad substitution

* whiptail one line

* fix syntax

* lnproxy: fix api access through nginx (#3671)

* lnproxy: fix api access through nginx
* fix tor config and fit the menu
* add to the menu and provision

* merge #3682

* cln update to v23.02, backup-plugin update, add poetry (#3684)

* cln backup-plugin update, add poetry
* fix mkdir error, remove commented code, fmt #3677
* poetry and path fixes
* add terminal feedback, format #3676
* detect the full name of the plugin
* install pyln-client tqdm with pip
* git-verify: add --keyid-format LONG
to recognise if the signing key is not the main key
* cln update to v23.02
* cln-grpc: add protobuf-compiler dep
* rtl update to v0.13.6 and formatting
* C-lightningREST update to v0.10.1

* CLN FAQ update (#3666)

* improve the detection of existing cln aliases
* add the emergencyrecover instructions to  CLN FAQ
* update help entries

* Update Tallycoin to version 1.8.0 (#3693)

* add tallycoin update info to CHANGES

* Fix typo in README.md (#3699)

excepted -> accepted

* #3694 add LCD info

* #3664 att timeout 30s to ln monitor calls (#3665)

* fix setting LND_REST_ENDPOINT (#3689)

* btcpay update v1.8.2, postgres database fix (#3697)

* btcpay update v1.8.0, postgres database fix

* btcpayserver update to v1.8.2

* update lnbits to 0.10.2 and use poetry instead of venv (#3703)

* fix apt update Key error for influx repo (#3711)

Co-authored-by: Patrick Scheich <patrick.scheich@syscovery.de>

* fix missing timeout value for nc cmnd (#3712)

Co-authored-by: Patrick Scheich <patrick.scheich@syscovery.de>

* #3706 Update CLN v23.02.2 (#3716)

* used patched/rolledback 23.02.2 release
* check rusty sig
* fix typo
* fix default lightning setting

* #3683 Update LIT to 0.8.6 (#3717)

* update LIT to 0.8.6
* activate lnd rpcmiddleware
* CHANGES.md

* #3667 change all up/download from sftp tp scp (#3718)

* #3722 add no hostkeys available detection (#3723)

* #1186 FinTS/HBCI interface (#3704)

* #1186 FinTS install script first draft

* only start app when blitz is ready

* improve menu

* improve dit lnbits config

* preserve edit

* improve edit

* improve edit

* fix insertion

* dont use fingerprint

* now use main repo

* add port

* show local ip

* fix typo

* show port SSL

* Update bonus.lndg.sh (#3725)

* Update bonus.lndg.sh

Changes version to v1.6.0.
Fixes update menu bug.
Cleans up code a bit (removes tabs and changes to spaces to match raspiblitz formats).

* Update bonus.lndg.sh

Cleaned up code, added requirements.txt install to updates (needed for this update, may be needed in future).

* #3725 update lndg version in CHANGES

* #3692 update lnd to v0.16.0-beta (#3732)

* update SD CARD base image info

* Clenaup CHANGES info

* RTL install fix (#3739)

* c-lightning-REST update to 0.10.2, fmt
* rtl: npm insatll with --legacy-peer-deps
* purge c-lightning-REST as well with RTL

* jam update to v0.1.5 (#3736)

* 3733 CLN GRPC > JRPC (#3741)

* change exit code

* change to cln_jrpc

* deactivate the cln_grpc settings

* set v1.9.0rc3 version

---------

Co-authored-by: openoms <oms@tuta.io>
Co-authored-by: Metallicc <72348+metallicc@users.noreply.github.com>
Co-authored-by: openoms <43343391+openoms@users.noreply.github.com>
Co-authored-by: DJ Booth <djbooth007@gmail.com>
Co-authored-by: Yuck Fou <115867254+YuckFouBTC@users.noreply.github.com>
Co-authored-by: dni  <office@dnilabs.com>
Co-authored-by: PatrickScheich <50054697+PatrickScheich@users.noreply.github.com>
Co-authored-by: Patrick Scheich <patrick.scheich@syscovery.de>
Co-authored-by: allyourbankarebelongtous <100060902+allyourbankarebelongtous@users.noreply.github.com>
2023-04-08 23:10:01 +02:00

418 lines
12 KiB
Bash
Executable file

#!/bin/bash
echo "Starting the main menu ..."
# MAIN MENU AFTER SETUP
source /home/admin/raspiblitz.info
source /mnt/hdd/raspiblitz.conf
# FUNCTIONS
confirmation()
{
local text=$1
local yesButtonText=$2
local noButtonText=$3
local defaultno=$4
local height=$5
local width=$6
local answer=-100
if [ $defaultno ]; then
whiptail --title " Confirmation " --defaultno --yes-button "$yesButtonText" --no-button "$noButtonText" --yesno " $text
" $height $width
else
whiptail --title " Confirmation " --yes-button "$yesButtonText" --no-button "$noButtonText" --yesno " $text
" $height $width
fi
answer=$?
return $answer
}
# get the local network IP to be displayed on the LCD
source <(/home/admin/_cache.sh get internet_localip)
if [ ${chain} = test ];then
netprefix="t"
elif [ ${chain} = sig ];then
netprefix="s"
elif [ ${chain} = main ];then
netprefix=""
fi
# BASIC MENU INFO
WIDTH=66
BACKTITLE="RaspiBlitz"
TITLE=""
MENU="Choose one of the following options:"
OPTIONS=()
plus=""
if [ "${runBehindTor}" = "on" ]; then
plus="/ tor"
fi
if [ ${#dynDomain} -gt 0 ]; then
plus="/ ${dynDomain} ${plus}"
fi
if [ ${#lightning} -gt 0 ]; then
plus="/ ${lightning} ${plus}"
fi
BACKTITLE="${internet_localip} / ${hostname} / ${network} ${plus}"
# Basic Options
OPTIONS+=(INFO "RaspiBlitz Status Screen")
# if LND is active
if [ "${lightning}" == "lnd" ] || [ "${lnd}" == "on" ]; then
OPTIONS+=(LND "LND Wallet Options")
fi
# if Core Lightning is active
if [ "${lightning}" == "cl" ] || [ "${cl}" == "on" ]; then
OPTIONS+=(CLN "Core Lightning Wallet Options")
fi
# Activated Apps/Services
if [ "${rtlWebinterface}" == "on" ]; then
OPTIONS+=(LRTL "LND RTL Webinterface")
fi
if [ "${crtlWebinterface}" == "on" ]; then
OPTIONS+=(CRTL "Core Lightning RTL Webinterface")
fi
if [ "${BTCPayServer}" == "on" ]; then
OPTIONS+=(BTCPAY "BTCPay Server Info")
fi
if [ "${lit}" == "on" ]; then
OPTIONS+=(LIT "LIT (loop, pool, faraday)")
fi
if [ "${lndg}" == "on" ]; then
OPTIONS+=(LNDG "LNDg (auto-rebalance, auto-fees)")
fi
if [ "${sparko}" == "on" ]; then
OPTIONS+=(SPARKO "Sparko Webwallet")
fi
if [ "${spark}" == "on" ]; then
OPTIONS+=(SPARK "Spark Wallet")
fi
if [ "${ElectRS}" == "on" ]; then
OPTIONS+=(ELECTRS "Electrum Rust Server")
fi
if [ "${BTCRPCexplorer}" == "on" ]; then
OPTIONS+=(EXPLORE "BTC RPC Explorer")
fi
if [ "${LNBits}" == "on" ]; then
if [ "${LNBitsFunding}" == "lnd" ] || [ "${LNBitsFunding}" == "tlnd" ] || [ "${LNBitsFunding}" == "slnd" ] || [ "${LNBitsFunding}" == "" ]; then
OPTIONS+=(LNBITS "LNbits on LND")
elif [ "${LNBitsFunding}" == "cl" ] || [ "${LNBitsFunding}" == "tcl" ] || [ "${LNBitsFunding}" == "scl" ]; then
OPTIONS+=(LNBITS "LNbits on Core Lightning")
fi
fi
if [ "${lndmanage}" == "on" ]; then
OPTIONS+=(LNDMANAGE "LND Manage Script")
fi
if [ "${loop}" == "on" ]; then
OPTIONS+=(LOOP "Loop In/Out Service")
fi
if [ "${mempoolExplorer}" == "on" ]; then
OPTIONS+=(MEMPOOL "Mempool Space")
fi
if [ "${specter}" == "on" ]; then
OPTIONS+=(SPECTER "Specter Desktop")
fi
if [ "${joinmarket}" == "on" ]; then
OPTIONS+=(JM "JoinMarket with JoininBox")
fi
if [ "${jam}" == "on" ]; then
OPTIONS+=(JAM "Jam (JoinMarket WebUI)")
fi
if [ "${faraday}" == "on" ]; then
OPTIONS+=(FARADAY "Faraday Channel Management")
fi
if [ "${bos}" == "on" ]; then
OPTIONS+=(BOS "Balance of Satoshis")
fi
if [ "${lnproxy}" == "on" ]; then
OPTIONS+=(LNPROXY "lnproxy server")
fi
if [ "${pyblock}" == "on" ]; then
OPTIONS+=(PYBLOCK "PyBlock")
fi
if [ "${thunderhub}" == "on" ]; then
OPTIONS+=(THUB "ThunderHub")
fi
if [ "${zerotier}" == "on" ]; then
OPTIONS+=(ZEROTIER "ZeroTier")
fi
if [ "${pool}" == "on" ]; then
OPTIONS+=(POOL "Lightning Pool")
fi
if [ "${sphinxrelay}" == "on" ]; then
OPTIONS+=(SPHINX "Sphinx Chat Relay")
fi
if [ "${helipad}" == "on" ]; then
OPTIONS+=(HELIPAD "Helipad Boostagram reader")
fi
if [ "${chantools}" == "on" ]; then
OPTIONS+=(CHANTOOLS "ChannelTools (Fund Rescue)")
fi
if [ "${homer}" == "on" ]; then
OPTIONS+=(HOMER "Homer Dashboard")
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi
if [ "${circuitbreaker}" == "on" ]; then
OPTIONS+=(CIRCUITBREAKER "Circuitbreaker (LND firewall)")
fi
if [ "${tallycoinConnect}" == "on" ]; then
OPTIONS+=(TALLY "Tallycoin Connect")
fi
if [ "${squeaknode}" == "on" ]; then
OPTIONS+=(SQUEAKNODE "Squeaknode")
fi
if [ "${itchysats}" == "on" ]; then
OPTIONS+=(ITCHYSATS "Show ItchySats details")
fi
if [ "${lightningtipbot}" == "on" ]; then
OPTIONS+=(LIGHTNINGTIPBOT "Show LightningTipBot details")
fi
if [ "${fints}" == "on" ]; then
OPTIONS+=(FINTS "Show FinTS/HBCI details")
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
if [ "${testnet}" == "on" ]; then
OPTIONS+=(TESTNETS "Testnet/Signet Options")
fi
OPTIONS+=(SETTINGS "Node Settings & Options")
OPTIONS+=(SERVICES "Additional Apps & Services")
OPTIONS+=(SYSTEM "Monitoring & Configuration")
OPTIONS+=(CONNECT "Connect Apps & Show Credentials")
OPTIONS+=(SUBSCRIBE "Manage Subscriptions")
OPTIONS+=(PASSWORD "Change Passwords")
if [ "${touchscreen}" == "1" ]; then
OPTIONS+=(SCREEN "Touchscreen Calibration")
fi
# final Options
OPTIONS+=(REPAIR "Repair Options")
OPTIONS+=(UPDATE "Check/Prepare RaspiBlitz Update")
OPTIONS+=(REBOOT "Reboot RaspiBlitz")
OPTIONS+=(OFF "PowerOff RaspiBlitz")
CHOICE_HEIGHT=$(("${#OPTIONS[@]}/2+1"))
HEIGHT=$((CHOICE_HEIGHT+6))
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
--title "$TITLE" \
--ok-label "Select" \
--cancel-label "Exit" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
case $CHOICE in
INFO)
echo "Gathering Information (please wait) ..."
while :
do
# show the same info as on LCD screen
/home/admin/00infoBlitz.sh ${chain}net ${lightning}
# 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
;;
LND)
/home/admin/99lndMenu.sh
;;
CLN)
/home/admin/99clMenu.sh ${chain}net
;;
CONNECT)
/home/admin/99connectMenu.sh
;;
SYSTEM)
/home/admin/99systemMenu.sh ${chain}net
;;
SCREEN)
dialog --title 'Touchscreen Calibration' --msgbox 'Choose OK and then follow the instructions on touchscreen for calibration.\n\nBest is to use a stylus for accurate touchscreen interaction.' 9 48
/home/admin/config.scripts/blitz.touchscreen.sh calibrate
;;
LRTL)
/home/admin/config.scripts/bonus.rtl.sh menu lnd mainnet
;;
CRTL)
/home/admin/config.scripts/bonus.rtl.sh menu cl mainnet
;;
BTCPAY)
/home/admin/config.scripts/bonus.btcpayserver.sh menu
;;
EXPLORE)
/home/admin/config.scripts/bonus.btc-rpc-explorer.sh menu
;;
ELECTRS)
/home/admin/config.scripts/bonus.electrs.sh menu
;;
LIT)
/home/admin/config.scripts/bonus.lit.sh menu
;;
LNDG)
/home/admin/config.scripts/bonus.lndg.sh menu
;;
SPARKO)
/home/admin/config.scripts/cl-plugin.sparko.sh menu mainnet
;;
SPARK)
/home/admin/config.scripts/cl.spark.sh menu mainnet
;;
LNBITS)
/home/admin/config.scripts/bonus.lnbits.sh menu
;;
LNDMANAGE)
/home/admin/config.scripts/bonus.lndmanage.sh menu
;;
LIGHTNINGTIPBOT)
/home/admin/config.scripts/bonus.lightningtipbot.sh menu
;;
LOOP)
/home/admin/config.scripts/bonus.loop.sh menu
;;
MEMPOOL)
/home/admin/config.scripts/bonus.mempool.sh menu
;;
SPECTER)
/home/admin/config.scripts/bonus.specter.sh menu
;;
JM)
/home/admin/config.scripts/bonus.joinmarket.sh menu
;;
JAM)
/home/admin/config.scripts/bonus.jam.sh menu
;;
FARADAY)
sudo /home/admin/config.scripts/bonus.faraday.sh menu
;;
BOS)
sudo /home/admin/config.scripts/bonus.bos.sh menu
;;
LNPROXY)
sudo /home/admin/config.scripts/bonus.lnproxy.sh menu
;;
PYBLOCK)
sudo /home/admin/config.scripts/bonus.pyblock.sh menu
;;
THUB)
sudo /home/admin/config.scripts/bonus.thunderhub.sh menu
;;
TALLY)
sudo /home/admin/config.scripts/bonus.tallycoin-connect.sh menu
;;
ZEROTIER)
sudo /home/admin/config.scripts/bonus.zerotier.sh menu
;;
POOL)
sudo /home/admin/config.scripts/bonus.pool.sh menu
;;
SPHINX)
sudo /home/admin/config.scripts/bonus.sphinxrelay.sh menu
;;
HELIPAD)
sudo /home/admin/config.scripts/bonus.helipad.sh menu
;;
SQUEAKNODE)
/home/admin/config.scripts/bonus.squeaknode.sh menu
;;
ITCHYSATS)
sudo /home/admin/config.scripts/bonus.itchysats.sh menu
;;
CHANTOOLS)
sudo /home/admin/config.scripts/bonus.chantools.sh menu
;;
CIRCUITBREAKER)
sudo /home/admin/config.scripts/bonus.circuitbreaker.sh menu
;;
FINTS)
sudo /home/admin/config.scripts/bonus.fints.sh menu
;;
TESTNETS)
/home/admin/00parallelChainsMenu.sh
;;
SUBSCRIBE)
/home/admin/config.scripts/blitz.subscriptions.py
;;
HOMER)
sudo /home/admin/config.scripts/bonus.homer.sh menu
;;
SERVICES)
/home/admin/00settingsMenuServices.sh
;;
SETTINGS)
/home/admin/00settingsMenuBasics.sh
;;
REPAIR)
/home/admin/98repairMenu.sh
;;
PASSWORD)
sudo /home/admin/config.scripts/blitz.passwords.sh set
;;
UPDATE)
/home/admin/99updateMenu.sh
;;
REBOOT)
clear
confirmation "Are you sure?" "Reboot" "Cancel" true 7 40
confirmationReboot=$?
if [ $confirmationReboot -eq 0 ]; then
clear
echo ""
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
exit 1
fi
;;
OFF)
clear
confirmation "Are you sure?" "PowerOff" "Cancel" true 7 40
confirmationShutdown=$?
if [ $confirmationShutdown -eq 0 ]; then
clear
echo ""
sudo /home/admin/config.scripts/blitz.shutdown.sh
exit 1
fi
;;
DELETE)
sudo /home/admin/XXcleanHDD.sh
sudo /home/admin/config.scripts/blitz.shutdown.sh reboot
exit 1
;;
*)
clear
exit 1
esac
# forward exit code of submenu to outside loop
# 0 = continue loop / everything else = break loop and exit to terminal
exitCodeOfSubmenu=$?
if [ "${exitCodeOfSubmenu}" != "0" ]; then
echo "# submenu signaled exit code '${exitCodeOfSubmenu}' --> forward to outside loop"
fi
exit ${exitCodeOfSubmenu}