Created
July 16, 2013 01:26
-
-
Save jobwat/6005039 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
#!/bin/bash | |
exit_code=0 | |
tests=' | |
echo -n "MemCache service listening... "; netstat -l | grep "memcache.*LISTEN" > /dev/null 2>&1 | |
echo -n "App returning Set-Cookie: XRSF-TOKEN header... "; curl -I localhost 2>/dev/null | grep "Set-Cookie: XSRF-TOKEN" > /dev/null | |
echo -n "App /status return 200... "; curl --connect-timeout 1 localhost/status > /dev/null 2>&1 | |
' | |
IFS=$'\n' | |
for test in $tests; do | |
eval $test | |
sub_code=$? | |
if [ ${sub_code} -ne 0 ]; then | |
exit_code=1 | |
echo "FAILED(${sub_code})." | |
else | |
echo "Ok." | |
fi | |
done | |
exit $exit_code | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment