This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# A script to monitor uptime of websites, | |
# and notify by email if a website is down. | |
SITES="ADD COMMA-SEPARATED WEBSITES HERE" | |
EMAILS="ADD COMMA-SEPARATED EMAILS HERE" | |
for SITE in $(echo $SITES | tr "," " "); do | |
if [ ! -z "${SITE}" ]; then | |
RESPONSE=$(curl -s --head $SITE) | |
if echo $RESPONSE | grep "200 OK" > /dev/null |