From a69262721b67d3bddae6b318deb5f3ef6e86bf76 Mon Sep 17 00:00:00 2001 From: openoms Date: Sun, 3 Jan 2021 19:39:57 +0000 Subject: [PATCH] connect: move while loop to script --- scripts/menu.bitcoinrpc.sh | 31 +++++++++++++++---------------- scripts/menu.tools.sh | 27 ++++++++++++--------------- scripts/start.joininbox.sh | 4 ---- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/scripts/menu.bitcoinrpc.sh b/scripts/menu.bitcoinrpc.sh index eb71fb9..59ff6b4 100755 --- a/scripts/menu.bitcoinrpc.sh +++ b/scripts/menu.bitcoinrpc.sh @@ -37,20 +37,7 @@ echo "# Checking the remote RPC connection with curl..." echo checkRPC -if [ $(checkRPC 2>/dev/null | grep -c "bitcoinRPC") -gt 0 ]; then - echo - echo "# Connected to bitcoinRPC successfully" - echo - echo "# Blockheight on the connected node: $(checkRPC 2>/dev/null|grep "result"|cut -d":" -f2|cut -d"," -f1)" - echo - python /home/joinmarket/set.bitcoinrpc.py --rpc_user=$rpc_user --rpc_pass=$rpc_pass --rpc_host=$rpc_host --rpc_port=$rpc_port - echo - echo "# The bitcoinRPC connection settings are set in the joinmarket.cfg" - echo - echo "Press ENTER to continue" - read key - exit 0 -else +while [ $(checkRPC 2>/dev/null | grep -c "bitcoinRPC") -eq 0 ]; do echo echo "# Could not connect to bitcoinRPC with the error:" checkRPC @@ -60,5 +47,17 @@ else echo echo "Press ENTER to retry or CTLR+C to abort" read key - exit 1 -fi + /home/joinmarket/menu.bitcoinrpc.sh +done + +echo +echo "# Connected to bitcoinRPC successfully" +echo +echo "# Blockheight on the connected node: $(checkRPC 2>/dev/null|grep "result"|cut -d":" -f2|cut -d"," -f1)" +echo +python /home/joinmarket/set.bitcoinrpc.py --rpc_user=$rpc_user --rpc_pass=$rpc_pass --rpc_host=$rpc_host --rpc_port=$rpc_port +echo +echo "# The bitcoinRPC connection settings are set in the joinmarket.cfg" +echo +echo "Press ENTER to continue" +read key \ No newline at end of file diff --git a/scripts/menu.tools.sh b/scripts/menu.tools.sh index 498500b..a0d8a43 100755 --- a/scripts/menu.tools.sh +++ b/scripts/menu.tools.sh @@ -48,20 +48,17 @@ CHOICE=$(dialog --clear \ case $CHOICE in CONNECT) - /home/joinmarket/menu.bitcoinrpc.sh - if ! connectedTrue; then - /home/joinmarket/menu.bitcoinrpc.sh - fi - echo - echo "Press ENTER to return to the menu..." - read key - ;; + /home/joinmarket/menu.bitcoinrpc.sh + echo + echo "Press ENTER to return to the menu..." + read key + ;; BOLTZMANN) - installBoltzmann - getTXID - python /home/joinmarket/start.boltzmann.py --txid=$(cat $txid) - echo - echo "Press ENTER to return to the menu..." - read key - ;; + installBoltzmann + getTXID + python /home/joinmarket/start.boltzmann.py --txid=$(cat $txid) + echo + echo "Press ENTER to return to the menu..." + read key + ;; esac \ No newline at end of file diff --git a/scripts/start.joininbox.sh b/scripts/start.joininbox.sh index 3234cf8..86913dc 100755 --- a/scripts/start.joininbox.sh +++ b/scripts/start.joininbox.sh @@ -52,10 +52,6 @@ if [ "$runningEnvEntry" -eq 0 ]; then # connect to remote node /home/joinmarket/menu.bitcoinrpc.sh - if ! connectedTrue; then - /home/joinmarket/menu.bitcoinrpc.sh - fi - # run config after install /home/joinmarket/install.joinmarket.sh config