Bash script to monitor website updates on specific words

#!/bin/bash
CTR=0

while true
do
    HOST="https://target-url-to-monitor.com"
    RESULT1="$(curl -s $HOST | grep 'your-specific-keywords')"
    if [[ ! -z ${RESULT1} ]]; then
        CTR=$[$CTR+1]
        break
    else
        sleep 900
    fi
done

if [[ $CTR -gt '0' ]]; then
    echo -e "$CTR matching results for your-specific-keywords" | mail -s "Your Email Subject" your@emailaddress.com
fi

Leave a Reply

Your email address will not be published. Required fields are marked *