#/bin/bash
export HOSTNAME=`hostname`
log show --style syslog --last 1h | fgrep "Wake reason" > /tmp/wakereasons.txt
mail -s "[$HOSTNAME] Wake Reasons 1h" smtp="emailz.d27n.com:587" -S smtp-use-starttls -S smtp-auth=login -S smtp-auth-user="steve@d27n.com" -S smtp-auth-password="L2sC7JikwX" -S ssl-verify=ignore steve@d27n.com < /tmp/wakereasons.txt
