Created
February 21, 2017 15:56
-
-
Save Kubuxu/c9d33276987f7c3f66e70e5b07fb3e26 to your computer and use it in GitHub Desktop.
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
server1 & | |
PID1=$! | |
server2 & | |
PID2=$! | |
TMPD=$(mktemp -d) | |
curl path1 > "$TMPD/resp1" & | |
CURL1=$! | |
curl path2 > "$TMPD/resp2" & | |
CURL2=$! | |
wait $CURL1 $CURL2 | |
function clean { | |
kill $PID1 $PID2 | |
} | |
trap clean EXIT | |
curl "path3?someparm=$(cat $TMPD/resp2)" > "$TMPD/resp3" | |
[ "$(jq .field "$TMPD/resp1")" = "$(jq .field "$TMPD/resp3")" ] || (echo "FAIL"; exit 1) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment