wrong handling of variables

This commit is contained in:
cventastic
2022-04-07 13:47:41 +02:00
parent f610486fcb
commit 82fee8d3d6

View File

@@ -20,6 +20,6 @@ pokt_blockheight=$(curl -s -X POST -H "Content-Type: application/json" -m 2 -d '
peers=$(curl -s -X POST -H "Content-Type: application/json" -m 2 -d '{"jsonrpc":"2.0","method":"net_peerCount","params": [],"id":1}' https://$HAPROXY_SERVER_NAME:$RPT/$HAPROXY_PROXY_NAME 2>/dev/null | jq '.result' -r) peers=$(curl -s -X POST -H "Content-Type: application/json" -m 2 -d '{"jsonrpc":"2.0","method":"net_peerCount","params": [],"id":1}' https://$HAPROXY_SERVER_NAME:$RPT/$HAPROXY_PROXY_NAME 2>/dev/null | jq '.result' -r)
# If any of the above tests failed, then exit 1. # If any of the above tests failed, then exit 1.
if [[ $our_blockheight -lt $($pokt_blockheight - 10) ]]; then exit 1; fi if [[ "$our_blockheight" -lt "$pokt_blockheight - 10" ]]; then exit 1; fi
if [[ `printf "%d" $peers` == "0" || `printf "%d" $peers` == "1" ]]; then exit 1; fi if [[ `printf "%d" $peers` == "0" || `printf "%d" $peers` == "1" ]]; then exit 1; fi
exit 0 exit 0