Skip to content

Instantly share code, notes, and snippets.

@saintmalik
Created August 21, 2021 18:33
Show Gist options
  • Save saintmalik/b10aa014a8f37365cadaf9e86db8a612 to your computer and use it in GitHub Desktop.
Save saintmalik/b10aa014a8f37365cadaf9e86db8a612 to your computer and use it in GitHub Desktop.
#!/bin/bash
CURRENTDATEONLY=`TZ='YOURTIMEZONE' date +"%b %d, %Y, %I:%M, %p"`
while IFS= read -r line; do
if curl -sLI $line | grep "200" > /dev/null; then
echo "$line is UP" > /dev/null
else
echo "$line is DOWN: ${CURRENTDATEONLY}"
fi
done < urls.txt
Replace "YOURTIMEZONE" with your own timezone, you can find your own timzone using this command: `timedatectl list-timezones`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment