diff --git a/home.admin/00infoBlitz.sh b/home.admin/00infoBlitz.sh index 440378b5f..f564e313b 100755 --- a/home.admin/00infoBlitz.sh +++ b/home.admin/00infoBlitz.sh @@ -1,5 +1,7 @@ #!/bin/bash +# 00infoBlitz.sh + # 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" diff --git a/home.admin/99clnMenu.sh b/home.admin/99clnMenu.sh index 0724dc34b..ff9aff7cc 100644 --- a/home.admin/99clnMenu.sh +++ b/home.admin/99clnMenu.sh @@ -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") @@ -59,64 +64,74 @@ CHOICE=$(dialog --clear \ 2>&1 >/dev/tty) case $CHOICE in - lnbalance) - clear - echo "*** YOUR SATOSHI BALANCES ***" - /home/admin/config.scripts/lnd.balance.sh ${network} - echo "Press ENTER to return to main menu." - read key - ;; - lnchannels) - clear - echo "*** YOUR LIGHTNING CHANNELS ***" - echo "" - echo "Capacity -> total sats in the channel (their side + your side)" - echo "Commit-Fee -> the fee that's charged if either side of the channel closes" - echo "Balance-Local -> sats on your side of the channel (outbound liquidity)" - echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)" - echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel" - echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding" - /home/admin/config.scripts/lnd.channels.sh ${network} - echo "Press ENTER to return to main menu." - read key - ;; - lnfwdreport) - /home/admin/config.scripts/lnd.fwdreport.sh -menu - echo "Press ENTER to return to main menu." - read key - ;; - PEERING) - /home/admin/BBconnectPeer.sh cln $NETWORK - ;; - FUNDING) - /home/admin/BBfundWallet.sh cln $NETWORK - ;; - CASHOUT) - /home/admin/BBcashoutWallet.sh - ;; - CHANNEL) - /home/admin/BBopenChannel.sh cln $NETWORK - ;; - SEND) - /home/admin/BBpayInvoice.sh cln $NETWORK - ;; - RECEIVE) - /home/admin/BBcreateInvoice.sh cln $NETWORK - ;; - NAME) - sudo /home/admin/config.scripts/lnd.setname.sh - noreboot=$? - if [ "${noreboot}" = "0" ]; then - sudo -u bitcoin ${network}-cli stop - echo "Press ENTER to Reboot." - read key - sudo /home/admin/XXshutdown.sh reboot - exit 0 - fi - ;; - CLOSEALL) - /home/admin/BBcloseAllChannels.sh - echo "Press ENTER to return to main menu." - read key - ;; + lnbalance) + clear + echo "*** YOUR SATOSHI BALANCES ***" + /home/admin/config.scripts/lnd.balance.sh ${network} + echo "Press ENTER to return to main menu." + read key + ;; + lnchannels) + clear + echo "*** YOUR LIGHTNING CHANNELS ***" + echo "" + echo "Capacity -> total sats in the channel (their side + your side)" + echo "Commit-Fee -> the fee that's charged if either side of the channel closes" + echo "Balance-Local -> sats on your side of the channel (outbound liquidity)" + echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)" + echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel" + echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding" + /home/admin/config.scripts/lnd.channels.sh ${network} + echo "Press ENTER to return to main menu." + read key + ;; + lnfwdreport) + /home/admin/config.scripts/lnd.fwdreport.sh -menu + echo "Press ENTER to return to main menu." + read key + ;; + PEERING) + /home/admin/BBconnectPeer.sh cln $NETWORK + ;; + FUNDING) + /home/admin/BBfundWallet.sh cln $NETWORK + ;; + CASHOUT) + /home/admin/BBcashoutWallet.sh + ;; + CHANNEL) + /home/admin/BBopenChannel.sh cln $NETWORK + ;; + SEND) + /home/admin/BBpayInvoice.sh cln $NETWORK + ;; + RECEIVE) + /home/admin/BBcreateInvoice.sh cln $NETWORK + ;; + NAME) + sudo /home/admin/config.scripts/lnd.setname.sh + noreboot=$? + if [ "${noreboot}" = "0" ]; then + sudo -u bitcoin ${network}-cli stop + echo "Press ENTER to Reboot." + read key + sudo /home/admin/XXshutdown.sh reboot + exit 0 + fi + ;; + CLOSEALL) + /home/admin/BBcloseAllChannels.sh + 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 diff --git a/home.admin/99lndMenu.sh b/home.admin/99lndMenu.sh index 63ea9d920..c8acf4c44 100644 --- a/home.admin/99lndMenu.sh +++ b/home.admin/99lndMenu.sh @@ -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" \ @@ -53,64 +58,74 @@ CHOICE=$(dialog --clear \ 2>&1 >/dev/tty) case $CHOICE in - lnbalance) - clear - echo "*** YOUR SATOSHI BALANCES ***" - /home/admin/config.scripts/lnd.balance.sh ${network} - echo "Press ENTER to return to main menu." - read key - ;; - lnchannels) - clear - echo "*** YOUR LIGHTNING CHANNELS ***" - echo "" - echo "Capacity -> total sats in the channel (their side + your side)" - echo "Commit-Fee -> the fee that's charged if either side of the channel closes" - echo "Balance-Local -> sats on your side of the channel (outbound liquidity)" - echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)" - echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel" - echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding" - /home/admin/config.scripts/lnd.channels.sh ${network} - echo "Press ENTER to return to main menu." - read key - ;; - lnfwdreport) - /home/admin/config.scripts/lnd.fwdreport.sh -menu - echo "Press ENTER to return to main menu." - read key - ;; - PEERING) - /home/admin/BBconnectPeer.sh - ;; - FUNDING) - /home/admin/BBfundWallet.sh - ;; - CASHOUT) - /home/admin/BBcashoutWallet.sh - ;; - CHANNEL) - /home/admin/BBopenChannel.sh - ;; - SEND) - /home/admin/BBpayInvoice.sh - ;; - RECEIVE) - /home/admin/BBcreateInvoice.sh - ;; - NAME) - sudo /home/admin/config.scripts/lnd.setname.sh - noreboot=$? - if [ "${noreboot}" = "0" ]; then - sudo -u bitcoin ${network}-cli stop - echo "Press ENTER to Reboot." - read key - sudo /home/admin/XXshutdown.sh reboot - exit 0 - fi - ;; - CLOSEALL) - /home/admin/BBcloseAllChannels.sh - echo "Press ENTER to return to main menu." - read key - ;; + lnbalance) + clear + echo "*** YOUR SATOSHI BALANCES ***" + /home/admin/config.scripts/lnd.balance.sh ${network} + echo "Press ENTER to return to main menu." + read key + ;; + lnchannels) + clear + echo "*** YOUR LIGHTNING CHANNELS ***" + echo "" + echo "Capacity -> total sats in the channel (their side + your side)" + echo "Commit-Fee -> the fee that's charged if either side of the channel closes" + echo "Balance-Local -> sats on your side of the channel (outbound liquidity)" + echo "Balance-Remote -> sats on their side of the channel (inbound liquidity)" + echo "Fee-Base -> fixed fee (in millisatoshis) per forwarding on channel" + echo "Fee-PerMil -> amount based fee (millisatoshis per 1 satoshi) on forwarding" + /home/admin/config.scripts/lnd.channels.sh ${network} + echo "Press ENTER to return to main menu." + read key + ;; + lnfwdreport) + /home/admin/config.scripts/lnd.fwdreport.sh -menu + echo "Press ENTER to return to main menu." + read key + ;; + PEERING) + /home/admin/BBconnectPeer.sh + ;; + FUNDING) + /home/admin/BBfundWallet.sh + ;; + CASHOUT) + /home/admin/BBcashoutWallet.sh + ;; + CHANNEL) + /home/admin/BBopenChannel.sh + ;; + SEND) + /home/admin/BBpayInvoice.sh + ;; + RECEIVE) + /home/admin/BBcreateInvoice.sh + ;; + NAME) + sudo /home/admin/config.scripts/lnd.setname.sh + noreboot=$? + if [ "${noreboot}" = "0" ]; then + sudo -u bitcoin ${network}-cli stop + echo "Press ENTER to Reboot." + read key + sudo /home/admin/XXshutdown.sh reboot + exit 0 + fi + ;; + CLOSEALL) + /home/admin/BBcloseAllChannels.sh + 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 diff --git a/home.admin/_commands.sh b/home.admin/_commands.sh index d06170b1e..b71442c54 100755 --- a/home.admin/_commands.sh +++ b/home.admin/_commands.sh @@ -129,6 +129,7 @@ function status() { while : do # show the same info as on LCD screen + # 00infoBlitz.sh /home/admin/00infoBlitz.sh $1 $2 # wait 6 seconds for user exiting loop #echo