Skip to content

Instantly share code, notes, and snippets.

@niko niko/stream_watch.sh
Created Sep 28, 2017

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.