Created
July 27, 2016 07:22
-
-
Save dciccale/c5b4216323e319d8845354b3b7bb419c to your computer and use it in GitHub Desktop.
Print http status every `n` seconds
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
# Print http status every n seconds | |
# n defaults to 1s | |
# usage: | |
# http-ping google.com .5 (500 milliseconds) | |
# http-ping google.com 2 (2 seconds) | |
http-ping() { | |
n=1 && (($#>1)) && n=$2 | |
while true | |
do | |
curl -o /dev/null --silent --head --write-out '%{http_code}\n' $1 | |
sleep ${n} | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment