Skip to content

Instantly share code, notes, and snippets.

@Husterknupp
Last active May 20, 2017 09:35
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 Husterknupp/989bc6085fa2e33cf13455a856dbb836 to your computer and use it in GitHub Desktop.
Save Husterknupp/989bc6085fa2e33cf13455a856dbb836 to your computer and use it in GitHub Desktop.
run speedtest script repeatedly and log results
#!/bin/bash
for i in `seq 1 1400`; do
echo "Start tryal $i"
result=$(speedtest)
echo 'done with the test.. writing results'
awkres=$(echo "$result" | awk -v date="$(date +"%Y-%m-%d %R")" -v sep="\," '/Download/ {print $2, sep, $3, sep, date}')
echo $awkres >> speedtest-results-Download
upres=$(echo "$result" | awk -v date="$(date +"%Y-%m-%d %R")" -v sep="\," '/Upload/ {print $2, sep, $3, sep, date}')
echo $upres >> speedtest-results-Upload
echo "End tryal $i"
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment