add SWITCHLN to lndMenu and clnMenu

This commit is contained in:
openoms
2021-05-28 20:28:56 +01:00
parent 8d0dae14c7
commit 7291e54174
4 changed files with 153 additions and 124 deletions

View File

@@ -1,5 +1,7 @@
#!/bin/bash
# 00infoBlitz.sh <cln|lnd> <testnet|mainnet|signet>
# load code software version
source /home/admin/_version.info
@@ -14,10 +16,6 @@ color_gray='\033[0;37m'
source /home/admin/raspiblitz.info 2>/dev/null
source /mnt/hdd/raspiblitz.conf 2>/dev/null
if [ $# -gt 0 ];then
CHAIN=$1
chain=${CHAIN::-3}
fi
source <(/home/admin/config.scripts/network.aliases.sh getvars $1 $2)
shopt -s expand_aliases
alias bitcoincli_alias="$bitcoincli_alias"

View File

@@ -45,6 +45,11 @@ if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi
if [ ${#LNdefault} -gt 0 ]&&[ $LNdefault = lnd ];then
OPTIONS+=(SWITCHLN "Use C-lightning as default")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi
#TODO OPTIONS+=(CASHOUT "Remove Funds from LND")
@@ -119,4 +124,14 @@ case $CHOICE in
echo "Press ENTER to return to main menu."
read key
;;
SWITCHLN)
clear
echo
# setting value in raspi blitz config
sudo sed -i "s/^LNdefault=.*/LNdefault=cln/g" /mnt/hdd/raspiblitz.conf
echo "# OK - LNdefault=cln is set in /mnt/hdd/raspiblitz.conf"
echo
echo "Press ENTER to return to main menu."
read key
;;
esac

View File

@@ -41,6 +41,11 @@ if [ ${#openChannels} -gt 0 ] && [ ${openChannels} -gt 0 ]; then
fi
OPTIONS+=(CASHOUT "Remove Funds from LND")
if [ ${#LNdefault} -gt 0 ]&&[ $LNdefault = cln ];then
OPTIONS+=(SWITCHLN "Use LND as default")
HEIGHT=$((HEIGHT+1))
CHOICE_HEIGHT=$((CHOICE_HEIGHT+1))
fi
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
@@ -113,4 +118,14 @@ case $CHOICE in
echo "Press ENTER to return to main menu."
read key
;;
SWITCHLN)
clear
echo
# setting value in raspi blitz config
sudo sed -i "s/^LNdefault=.*/LNdefault=lnd/g" /mnt/hdd/raspiblitz.conf
echo "# OK - LNdefault=lnd is set in /mnt/hdd/raspiblitz.conf"
echo
echo "Press ENTER to return to main menu."
read key
;;
esac

View File

@@ -129,6 +129,7 @@ function status() {
while :
do
# show the same info as on LCD screen
# 00infoBlitz.sh <cln|lnd> <testnet|mainnet|signet>
/home/admin/00infoBlitz.sh $1 $2
# wait 6 seconds for user exiting loop
#echo