Created
August 21, 2021 18:33
-
-
Save saintmalik/b10aa014a8f37365cadaf9e86db8a612 to your computer and use it in GitHub Desktop.
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/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