From 839c2c807ed4c8bca1e1ec1570766e7ce2d48670 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 18 Dec 2019 22:50:42 +0100 Subject: [PATCH] index info --- .../config.scripts/bonus.btc-rpc-explorer.sh | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index 53a276d1c..c67f07049 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -7,12 +7,33 @@ # command info if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then echo "small config script to switch BTC-RPC-explorer on or off" - echo "bonus.btc-rcp-explorer.sh [on|off]" + echo "bonus.btc-rcp-explorer.sh [status|on|off]" exit 1 fi +# add default value to raspi config if needed +if [ ${#BTCRPCexplorer} -eq 0 ]; then + echo "BTCRPCexplorer=off" >> /mnt/hdd/raspiblitz.conf +fi source /mnt/hdd/raspiblitz.conf +# status +if [ "$1" = "status" ]; then + + if [ "${BTCRPCexplorer}" = "on" ]; then + echo "configured=1" + + # check indexing + source <(sudo /home/admin/config.scripts/network.txindex.sh status) + echo "isIndexed=${isIndexed}" + echo "indexInfo=${indexInfo}" + + else + echo "configured=0" + fi + exit 0 +fi + # determine nodeJS DISTRO isARM=$(uname -m | grep -c 'arm') isAARCH64=$(uname -m | grep -c 'aarch64') @@ -37,11 +58,6 @@ echo "FAIL: Was not able to determine architecture" exit 1 fi -# add default value to raspi config if needed -if [ ${#BTCRPCexplorer} -eq 0 ]; then - echo "BTCRPCexplorer=off" >> /mnt/hdd/raspiblitz.conf -fi - # stop service echo "making sure services are not running" sudo systemctl stop btc-rpc-explorer 2>/dev/null