Skip to content

Instantly share code, notes, and snippets.

@jab416171 jab416171/speedtestcsv.sh
Last active Aug 29, 2015

Embed
What would you like to do?
#!/bin/sh
filename=/tmp/speedtest_results
result=$(speedtest --simple)
download=$(echo $result | grep -oP "(?<=Download: )[0-9\.]* .*?/s")
upload=$(echo $result | grep -oP "(?<=Upload: )[0-9\.]* .*?/s")
ping=$(echo $result | grep -oP "(?<=Ping: )[0-9\.]* .*?ms")
if [ ! -e $filename ]; then
echo "\"Date\",\"Upload\",\"Download\",\"Ping\"" > $filename
fi
echo "\"$(date)\",\"$upload\",\"$download\",\"$ping\"" >> $filename
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.