When using a VPS to mine, I needed to know when an instance found a block.
This will monitor for blocks each minute and e-mail you when "You've Got Coin". The e-mail includes the hostname of the machine, and the amount.
Sign up for SendGrid using this referral link:
http://sendgrid.tellapal.com/a/clk/N4V2k They have a 200 e-mail a day free program.
Fill in your e-mail address, and your SendGrid user/pass.
It is set to query primecoind, but you can change that to any other coin with a search/replace.
#!/bin/bash
email=""
sendgriduser=""
sendgridpass=""
hostname=$(hostname)
lasttranscount=$(primecoind listtransactions | grep "txid" | wc -l)
echo "Original transactions count: $lasttranscount"
#loop continuously and check every minute for more transactions
#email a notification
while :
do
#Get a count of transactions
transcount=$(primecoind listtransactions | grep "txid" | wc -l)
echo "Current transaction count: $transcount"
if [ "$transcount" -gt "$lasttranscount" ]; then
#Get the amount of the last transaction
amount=$(primecoind listtransactions | grep "amount" | tail -1)
#Send e-mail via SendGrid
wget -qO- "https://sendgrid.com/api/mail.send.json?api_user=$sendgriduser&api_key=$sendgridpass&to=$email&subject=You%27ve%20Got%20Coin&text=Found%20by%20Machine:%20$hostname%20%20$amount&from=$email"
echo "Notification Sent"
fi
lasttranscount="$transcount"
sleep 60
done
It could be easily modified to send coin to your central wallet address.
If this is helpful to you: AcRrefxiqDNpdm4YAr6nqHpTVJYtcFW6Ct (XPM)