Created
September 28, 2017 14:33
-
-
Save niko/fd0af745e4dfd5a98423fcc8caf1ef39 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 | |
trap 'pkill -P $$' INT TERM EXIT | |
for s in "$@"; do | |
( | |
while true; do | |
t=$(date +'%Y-%m-%d_%H:%M:%S') | |
echo "${t} started ${s} …" | |
curl --silent --show-error -H 'user-agent: stream-watch.sh' "${s}?test-ice-${t}" | wc -c | |
echo "bytes transfered." | |
echo "$(date +'%Y-%m-%d_%H:%M:%S') ended ${s}" | |
sleep 10 | |
done | |
) & | |
done | |
wait | |
# kill all children of current process: | |
pkill -P $$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment