Guest User

Untitled

a guest
Feb 8th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. rpcuser=kek
  4. rpcpass=kek
  5.  
  6. currentblock=$(btcctl --rpcuser=${rpcuser} --rpcpass=${rpcpass} getblockcount)
  7. peerinfo=$(btcctl --rpcuser=${rpcuser} --rpcpass=${rpcpass} getpeerinfo)
  8. node=$(echo ${peerinfo} | jq ".[] | select(.syncnode == true)")
  9. highestblock=$(echo ${node} | jq ".startingheight")
  10. lastrecv=$(echo ${node} | jq ".lastrecv")
  11. currentdate=$(date +%s)
  12.  
  13. echo "${currentblock} / ${highestblock} offset: $(($currentdate-$lastrecv))"
Add Comment
Please, Sign In to add comment