Created
April 24, 2018 03:34
-
-
Save yondonfu/790b29f2cc7a880370d11eed9a1f5dca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res=$(curl -s -X POST -H "Content-Type: application/json" localhost:8545 --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' | jq '.result') | |
temp=${res%\"} | |
temp=${temp#\"} | |
blk=${temp:2} | |
blk=$((0x${blk})) | |
while (( $blk <= 5264265 )) | |
do | |
echo $blk | |
sleep 2 | |
res=$(curl -s -X POST -H "Content-Type: application/json" localhost:8545 --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' | jq '.result') | |
temp=${res%\"} | |
temp=${temp#\"} | |
blk=${temp:2} | |
blk=$((0x${blk})) | |
done | |
if (( $blk >= 5264265 )); then | |
parityPID=$(pgrep parity) | |
kill -s 2 $parityPID | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment