Last active
January 3, 2020 09:05
-
-
Save hadrienblanc/385be8e26d3e5b9f46395fbdf634088f 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
echo "[test 200]" | |
echo "Script that tests we receive a 200 http code response from an array of urls." | |
echo "" | |
urls=( | |
https://www.google.fr | |
https://www.google.com | |
) | |
for url in "${urls[@]}" | |
do | |
echo "\n- $url" | |
status_code=$(curl -s -o /dev/null -w "%{http_code}\n" $url) | |
if [[ "$status_code" -ne 200 ]] ; then | |
echo "Do not return a 200 http code ❌" | |
else | |
echo "✅" | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment