Skip to content

Commit

Permalink
connect: move while loop to script
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Jan 3, 2021
1 parent 5e28051 commit a692627
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 35 deletions.
31 changes: 15 additions & 16 deletions scripts/menu.bitcoinrpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
27 changes: 12 additions & 15 deletions scripts/menu.tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions scripts/start.joininbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a692627

Please sign in to comment.