From d3b442b7f7a1e0c0c7acac7a467da051e7644f4b Mon Sep 17 00:00:00 2001 From: nahuhh <50635951+nahuhh@users.noreply.github.com> Date: Tue, 4 Jun 2024 19:31:08 -0500 Subject: [PATCH] check that remote node actually works --- install.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index cb851e2..3355c94 100755 --- a/install.sh +++ b/install.sh @@ -132,9 +132,16 @@ until [[ "$l" =~ ^[12]$ ]]; do read -p 'Select an option [1|2]: ' l case $l in 1) - read -p 'Enter Address of Monero node [example: 192.168.1.123] ' monerod_addr - read -p 'Enter RPC Port for the Monero node [example: 18081] ' monerod_port - $green"\nLook good? $monerod_addr:$monerod_port"; $nocolor + until [[ $checknode ]]; do + read -p 'Enter Address of Monero node [example: 192.168.1.123] ' monerod_addr + read -p 'Enter RPC Port for the Monero node [example: 18081] ' monerod_port + checknode=$(curl -sk http://$monerod_addr:$monerod_port/get_info) + if [[ $checknode ]]; then + $green"\nSuccessfully connected to the XMR node @ $monerod_addr:$monerod_port"; $nocolor + else + $red"\nThe node at $monerod_addr:$monerod_port is not accessible. Try again\n\n"; $nocolor + fi + done ;; 2) $green"\nBasicSwapDEX will run the Monero node for you."; $nocolor