diff --git a/home.admin/99systemMenu.sh b/home.admin/99systemMenu.sh index 72baecdf3..d1a5a74a2 100644 --- a/home.admin/99systemMenu.sh +++ b/home.admin/99systemMenu.sh @@ -6,14 +6,14 @@ 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) +source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1) # BASIC MENU INFO HEIGHT=12 # add 6 to CHOICE_HEIGHT + MENU lines WIDTH=64 CHOICE_HEIGHT=6 # 1 line / OPTIONS BACKTITLE="RaspiBlitz" -TITLE="System Options" +TITLE="${CHAIN} System Options" MENU="" # adds lines to HEIGHT OPTIONS=() # adds lines to HEIGHt + CHOICE_HEIGHT @@ -22,6 +22,13 @@ OPTIONS+=(${network}CONF "Edit the bitcoin.conf") OPTIONS+=(LNDLOG "Monitor the lnd.log for ${CHAIN}") OPTIONS+=(LNDCONF "Edit the lnd.conf for ${CHAIN}") +if grep "${netprefix}cln=on" /mnt/hdd/raspiblitz.conf;then + OPTIONS+=(CLNLOG "Monitor the CLN log for ${CHAIN}") + OPTIONS+=(CLNCONF "Edit the CLN config for ${CHAIN}") + HEIGHT=$((HEIGHT+2)) + CHOICE_HEIGHT=$((CHOICE_HEIGHT+2)) +fi + if [ "${runBehindTor}" == "on" ]; then OPTIONS+=(TORLOG "Monitor the Tor Service with Nyx") OPTIONS+=(TORRC "Edit the Tor Configuration") @@ -43,11 +50,11 @@ CHOICE=$(dialog --clear \ case $CHOICE in ${network}LOG) if [ ${CHAIN} = signet ]; then - bitcoinlogpath="sudo tail -f /mnt/hdd/bitcoin/signet/debug.log" + bitcoinlogpath="/mnt/hdd/bitcoin/signet/debug.log" elif [ ${CHAIN} = testnet ]; then - bitcoinlogpath="sudo tail -f /mnt/hdd/bitcoin/testnet3/debug.log" + bitcoinlogpath="/mnt/hdd/bitcoin/testnet3/debug.log" elif [ ${CHAIN} = mainnet ]; then - bitcoinlogpath="sudo tail -f /mnt/hdd/bitcoin/debug.log" + bitcoinlogpath="/mnt/hdd/bitcoin/debug.log" fi clear echo @@ -95,13 +102,40 @@ case $CHOICE in Do you want to restart LND now?" 10 55 if [ $? -eq 0 ]; then echo "# Restarting LND" - sudo systemctl restart lnd + sudo systemctl restart ${netprefix}lnd else echo "# Continue without restarting." fi else echo "# No change made" - fi;; + fi;; + CLNLOG) + clear + echo + echo "Will follow the /home/bitcoin/.lightning/${CLNETWORK}/cl.log" + echo "running 'sudo tail -n 30 -f /home/bitcoin/.lightning/${CLNETWORK}/cl.log'" + 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 /home/bitcoin/.lightning/${CLNETWORK}/cl.log;; + CLNCONF) + if /home/admin/config.scripts/blitz.setconf.sh "/home/bitcoin/.lightning/${netprefix}config" "root" + then + whiptail \ + --title "Restart" --yes-button "Restart" --no-button "Not now" \ + --yesno "To apply the new settings C-lightning needs to restart. + Do you want to restart C-lightning now?" 0 0 + if [ $? -eq 0 ]; then + echo "# Restarting C-lightning" + sudo systemctl restart ${netprefix}lightningd + else + echo "# Continue without restarting." + fi + else + echo "# No change made" + fi;; TORLOG) sudo -u debian-tor nyx;; TORRC)