Created
September 1, 2015 18:53
-
-
Save ramr/c0f2c55bcbeb65555175 to your computer and use it in GitHub Desktop.
recreate/test redispatches
This file contains hidden or 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 | |
cookiejar="/tmp/cookiejar" | |
host="hello.openshift.test" | |
uri="http://$host/helasasa/" | |
to_opts="--connect-timeout 1 -m 1" | |
status=$(curl -s $to_opts -qw '%{http_code}' --resolve $host:80:10.0.2.15 \ | |
-c "$cookiejar" -b "$cookiejar" -o /dev/null $uri) | |
echo "$(date): Initial cookie set status = $status" | |
echo "$(date): Munging cookie ..." | |
[ -f "$cookiejar" ] && sed -i 's#8080#9999#g' "$cookiejar" | |
while true; do | |
status=$(curl -s $to_opts -qw '%{http_code}' --resolve $host:80:10.0.2.15 \ | |
-b "$cookiejar" -o /dev/null $uri) | |
if [ "$status" == "200" ]; then | |
echo -n "." | |
else | |
echo "" && echo " @@@@ got an error at $(date): $status" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment