Skip to content

Instantly share code, notes, and snippets.

@elhardoum
Last active May 20, 2020 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elhardoum/99e3205c1c0d7fc3bfcc40e9023e627d to your computer and use it in GitHub Desktop.
Save elhardoum/99e3205c1c0d7fc3bfcc40e9023e627d to your computer and use it in GitHub Desktop.
Testing your load balancer servers for downtime, ignores SSL errors assuming you're testing the core of your web service
#!/usr/bin/env sh
host="www.example.com"
ips=(
93.184.216.34
)
for ip in "${ips[@]}"; do
curl -H "Host: $host" "https://$ip/" -kIs |grep 200\ OK >/dev/null && (
echo "\033[0;32m[✓] $ip\t(passed)"
) || (
echo "\033[0;31m[×] $ip\t(failed)"
)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment