Skip to content

Instantly share code, notes, and snippets.

@hadrienblanc
Last active January 3, 2020 09:05
Show Gist options
  • Save hadrienblanc/385be8e26d3e5b9f46395fbdf634088f to your computer and use it in GitHub Desktop.
Save hadrienblanc/385be8e26d3e5b9f46395fbdf634088f to your computer and use it in GitHub Desktop.
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