From ed828455d8a0a67c4c9fdc90bb44abb21989b0ef Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 25 Jan 2019 21:56:24 +0100 Subject: [PATCH] #292 safeguarding against network info loss --- home.admin/BBcashoutWallet.sh | 1 + home.admin/BBcloseAllChannels.sh | 1 + home.admin/BBconnectPeer.sh | 1 + home.admin/BBcreateInvoice.sh | 1 + home.admin/BBfundWallet.sh | 1 + home.admin/BBopenChannel.sh | 1 + home.admin/BBpayInvoice.sh | 1 + 7 files changed, 7 insertions(+) diff --git a/home.admin/BBcashoutWallet.sh b/home.admin/BBcashoutWallet.sh index f6c6b3a..c34f097 100755 --- a/home.admin/BBcashoutWallet.sh +++ b/home.admin/BBcashoutWallet.sh @@ -7,6 +7,7 @@ echo "please wait ..." # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then chain=$(${network}-cli -datadir=/home/bitcoin/.${network} getblockchaininfo | jq -r '.chain') fi diff --git a/home.admin/BBcloseAllChannels.sh b/home.admin/BBcloseAllChannels.sh index 5a35d14..5d06697 100755 --- a/home.admin/BBcloseAllChannels.sh +++ b/home.admin/BBcloseAllChannels.sh @@ -3,6 +3,7 @@ # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then chain=$(${network}-cli getblockchaininfo | jq -r '.chain') fi diff --git a/home.admin/BBconnectPeer.sh b/home.admin/BBconnectPeer.sh index 3d9734f..f721e89 100755 --- a/home.admin/BBconnectPeer.sh +++ b/home.admin/BBconnectPeer.sh @@ -5,6 +5,7 @@ _error="./.error.out" # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBcreateInvoice.sh b/home.admin/BBcreateInvoice.sh index 0678ad7..797070c 100755 --- a/home.admin/BBcreateInvoice.sh +++ b/home.admin/BBcreateInvoice.sh @@ -6,6 +6,7 @@ sudo chmod 7777 ${_error} # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBfundWallet.sh b/home.admin/BBfundWallet.sh index 207d4f4..0278f2e 100755 --- a/home.admin/BBfundWallet.sh +++ b/home.admin/BBfundWallet.sh @@ -3,6 +3,7 @@ # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBopenChannel.sh b/home.admin/BBopenChannel.sh index c1095d6..559a599 100755 --- a/home.admin/BBopenChannel.sh +++ b/home.admin/BBopenChannel.sh @@ -5,6 +5,7 @@ _error="./.error.out" # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain') diff --git a/home.admin/BBpayInvoice.sh b/home.admin/BBpayInvoice.sh index 26765ad..f076bd2 100755 --- a/home.admin/BBpayInvoice.sh +++ b/home.admin/BBpayInvoice.sh @@ -5,6 +5,7 @@ _error="./.error.out" # load raspiblitz config data (with backup from old config) source /mnt/hdd/raspiblitz.conf 2>/dev/null if [ ${#network} -eq 0 ]; then network=`cat .network`; fi +if [ ${#network} -eq 0 ]; then network="bitcoin"; fi if [ ${#chain} -eq 0 ]; then echo "gathering chain info ... please wait" chain=$(${network}-cli getblockchaininfo | jq -r '.chain')