...
Code Block | ||
---|---|---|
| ||
curl websiteaddress.com | grep -q "Down for Maintenance"
if [ $? -eq 0 ] ; then
echo "Website is Down" | mail -s "Website is down for maintenance" email@address.com
; fi |
The grep -q tells grep to not output anything other than 0 if a match was found and 1 if no match was found.