mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-23 09:16:57 +02:00
SYSTEM: add CLNLOG and CLNCONF options
This commit is contained in:
@@ -6,14 +6,14 @@ source /home/admin/raspiblitz.info
|
|||||||
source /mnt/hdd/raspiblitz.conf
|
source /mnt/hdd/raspiblitz.conf
|
||||||
|
|
||||||
# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cln> <mainnet|testnet|signet>)
|
# source <(/home/admin/config.scripts/network.aliases.sh getvars <lnd|cln> <mainnet|testnet|signet>)
|
||||||
source <(/home/admin/config.scripts/network.aliases.sh getvars "" $1)
|
source <(/home/admin/config.scripts/network.aliases.sh getvars cln $1)
|
||||||
|
|
||||||
# BASIC MENU INFO
|
# BASIC MENU INFO
|
||||||
HEIGHT=12 # add 6 to CHOICE_HEIGHT + MENU lines
|
HEIGHT=12 # add 6 to CHOICE_HEIGHT + MENU lines
|
||||||
WIDTH=64
|
WIDTH=64
|
||||||
CHOICE_HEIGHT=6 # 1 line / OPTIONS
|
CHOICE_HEIGHT=6 # 1 line / OPTIONS
|
||||||
BACKTITLE="RaspiBlitz"
|
BACKTITLE="RaspiBlitz"
|
||||||
TITLE="System Options"
|
TITLE="${CHAIN} System Options"
|
||||||
MENU="" # adds lines to HEIGHT
|
MENU="" # adds lines to HEIGHT
|
||||||
OPTIONS=() # adds lines to HEIGHt + CHOICE_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+=(LNDLOG "Monitor the lnd.log for ${CHAIN}")
|
||||||
OPTIONS+=(LNDCONF "Edit the lnd.conf 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
|
if [ "${runBehindTor}" == "on" ]; then
|
||||||
OPTIONS+=(TORLOG "Monitor the Tor Service with Nyx")
|
OPTIONS+=(TORLOG "Monitor the Tor Service with Nyx")
|
||||||
OPTIONS+=(TORRC "Edit the Tor Configuration")
|
OPTIONS+=(TORRC "Edit the Tor Configuration")
|
||||||
@@ -43,11 +50,11 @@ CHOICE=$(dialog --clear \
|
|||||||
case $CHOICE in
|
case $CHOICE in
|
||||||
${network}LOG)
|
${network}LOG)
|
||||||
if [ ${CHAIN} = signet ]; then
|
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
|
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
|
elif [ ${CHAIN} = mainnet ]; then
|
||||||
bitcoinlogpath="sudo tail -f /mnt/hdd/bitcoin/debug.log"
|
bitcoinlogpath="/mnt/hdd/bitcoin/debug.log"
|
||||||
fi
|
fi
|
||||||
clear
|
clear
|
||||||
echo
|
echo
|
||||||
@@ -95,7 +102,34 @@ case $CHOICE in
|
|||||||
Do you want to restart LND now?" 10 55
|
Do you want to restart LND now?" 10 55
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "# Restarting LND"
|
echo "# Restarting LND"
|
||||||
sudo systemctl restart lnd
|
sudo systemctl restart ${netprefix}lnd
|
||||||
|
else
|
||||||
|
echo "# Continue without restarting."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "# No change made"
|
||||||
|
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
|
else
|
||||||
echo "# Continue without restarting."
|
echo "# Continue without restarting."
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user