#!/bin/bash set -euf latestparent=unknown latestbits=0 while true do echo $(date): checking for new blocks... >&2 curl -s http://hash.h10a.de/?raw > latestinfo bits=$(head -1 latestinfo) parent=$(tail -n +2 latestinfo | sort -k2 -n|tail -1|cut -f1) if [ $parent != $latestparent ] || [ $bits != $latestbits ]; then latestparent=$parent latestbits=$bits echo $(date): new block found >&2 echo $latestbits $latestparent fi sleep 3 done