Skip to content

Instantly share code, notes, and snippets.

@niko
Created September 28, 2017 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niko/fd0af745e4dfd5a98423fcc8caf1ef39 to your computer and use it in GitHub Desktop.
Save niko/fd0af745e4dfd5a98423fcc8caf1ef39 to your computer and use it in GitHub Desktop.
#!/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