For reasons unclear to me, the email logic I'd added seemed to break things, so I've removed it. The script now will send an email when it detects a failure. By default, the email will go to root; if you want it to go to some other address, specify it on the command line: zpscan.sh poolname nobody@example.com
.