From 7284a25479dbf34423dd7a39c6809be1cc3b293a Mon Sep 17 00:00:00 2001 From: openoms Date: Mon, 28 Jun 2021 11:48:36 +0100 Subject: [PATCH] add the SYSTEM menu for parallel chains --- home.admin/00parallelChainsMenu.sh | 2 +- home.admin/99systemMenu.sh | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/home.admin/00parallelChainsMenu.sh b/home.admin/00parallelChainsMenu.sh index 3be449668..34d2c3b94 100644 --- a/home.admin/00parallelChainsMenu.sh +++ b/home.admin/00parallelChainsMenu.sh @@ -92,7 +92,7 @@ OPTIONS+=(SERVICES "Additional Apps & Services on ${CHAIN}") HEIGHT=$((HEIGHT+1)) CHOICE_HEIGHT=$((CHOICE_HEIGHT+1)) fi -#TODO OPTIONS+=(SYSTEM "Monitoring & Configuration") +OPTIONS+=(SYSTEM "Monitoring & Configuration") #TODO OPTIONS+=(CONNECT "Connect Apps & Show Credentials") if [ $nonDefaultLNtype = 1 ];then diff --git a/home.admin/99systemMenu.sh b/home.admin/99systemMenu.sh index 00ff764a9..6a959da9a 100644 --- a/home.admin/99systemMenu.sh +++ b/home.admin/99systemMenu.sh @@ -5,6 +5,9 @@ echo "get raspiblitz config" source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf +# source <(/home/admin/config.scripts/network.aliases.sh getvars ) +source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2) + # BASIC MENU INFO HEIGHT=12 # add 6 to CHOICE_HEIGHT + MENU lines WIDTH=64 @@ -39,26 +42,33 @@ CHOICE=$(dialog --clear \ case $CHOICE in ${network}LOG) + if [ ${CHAIN} = signet ]; then + bitcoinlogpath="sudo tail -f /mnt/hdd/bitcoin/signet/debug.log" + elif [ ${CHAIN} = testnet ]; then + bitcoinlogpath="sudo tail -f /mnt/hdd/bitcoin/testnet3/debug.log" + elif [ ${CHAIN} = mainnet ]; then + bitcoinlogpath="sudo tail -f /mnt/hdd/bitcoin/debug.log" + fi clear echo - echo "Will follow the /mnt/hdd/${network}/debug.log" - echo "running: 'sudo tail -n 30 -f /mnt/hdd/${network}/debug.log'" + echo "Will follow the ${bitcoinlogpath}" + echo "running: 'sudo tail -n 30 -f ${bitcoinlogpath}'" echo echo "Press ENTER to continue" echo "use CTRL+C any time to abort .. then use command 'raspiblitz' to return to menu" echo "###############################################################################" read key - sudo tail -n 30 -f /mnt/hdd/${network}/debug.log;; + sudo tail -n 30 -f ${bitcoinlogpath};; ${network}CONF) if /home/admin/config.scripts/blitz.setconf.sh "/mnt/hdd/${network}/${network}.conf" "root" then whiptail \ --title "Restart" --yes-button "Restart" --no-button "Not now" \ - --yesno "To apply the new settings ${network}d needs to restart. - Do you want to restart ${network}d now?" 10 55 + --yesno "To apply the new settings ${netprefix}${network}d needs to restart. + Do you want to restart ${netprefix}${network}d now?" 10 55 if [ $? -eq 0 ]; then - echo "# Restarting ${network}d" - sudo systemctl restart ${network}d + echo "# Restarting ${netprefix}${network}d" + sudo systemctl restart ${netprefix}${network}d else echo "# Continue without restarting." fi @@ -77,7 +87,7 @@ case $CHOICE in read key sudo tail -n 30 -f /mnt/hdd/lnd/logs/${network}/${chain}net/lnd.log;; LNDCONF) - if /home/admin/config.scripts/blitz.setconf.sh "/mnt/hdd/lnd/lnd.conf" "root" + if /home/admin/config.scripts/blitz.setconf.sh "/mnt/hdd/lnd/${netprefix}lnd.conf" "root" then whiptail \ --title "Restart" --yes-button "Restart" --no-button "Not now" \