Created
March 31, 2015 19:53
-
-
Save ohartl/4f1fca117f7b2640de70 to your computer and use it in GitHub Desktop.
check http status code with curl
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 | |
http_status=`curl -s -I https://de.php.net/distributions/php-5.6.7.tar.gz | grep HTTP/1.1 | awk {'print $2'}` | |
echo $http_status | |
if [ $http_status -eq 200 ]; then | |
echo "this is HTTP Status 200" | |
else | |
echo "not 200" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment