Advertisement
Guest User

Untitled

a guest
Nov 14th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. # assumes that bitcoind is running
  4. blockmax=$1
  5. should_continue=0
  6.  
  7. while [ $should_continue -eq 0 ]; do
  8.     current_block=`bitcoind getblockcount`
  9.     if [ $current_block -lt $blockmax ]; then
  10.         echo "bitcoind at $current_block, not yet at $blockmax"
  11.     elif [ $current_block -gt $blockmax ]; then
  12.         echo "bitcoind passed $1"
  13.         should_continue=1
  14.         exit
  15.     elif [ $current_block -eq $blockmax ]; then
  16.         bitcoind stop
  17.         should_continue=1
  18.         exit
  19.     fi
  20.     sleep 1
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement