Bash script to sound when coins received

转摘自社区论坛,由jago25_98 and kostagr33k提供。

#!/bin/sh
#needs:
# - pulseaudio - for paplay
# - curl
# - blockexplorer not 404

address=$1
confirmations="6"
balance=$(curl --fail "http://blockexplorer.com/q/getreceivedbyaddr
ess/$address/$confirmations") || { echo "Unable to retrieve bala
nce" >&2; exit 1; }

while [ `echo ${balance} == 0| bc` -eq 1 ] 
do
 sleep 1s 
 echo ${balance}
done
上一篇:
下一篇:

Comments