#!/bin/bash prev_count=0 count=$(grep -i "`date --date='today' '+%b %e'`" /var/log/maillog | egrep -wi 'Read-only file system' | wc -l) if [ -f /root/read_only_alerted_today ] ; then echo "Already alerted for this" elif [ "$prev_count" -lt "$count" ] ; then /usr/local/bin/curl -S -F "token=REMOVED" \ -F "user=REMOVED" \ -F "title=Read-Only FS Alert" \ -F "message=Read-only FS on LONGHORN" https://api.pushover.net/1/messages.json /usr/bin/touch /root/read_only_alerted_today fi