Created
March 2, 2016 18:50
A script that appends to a CSV file the results of your internet speed test (via speediest-cli)
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 | |
OUTPUT="`speedtest-cli --simple`" | |
PING=`echo "$OUTPUT" | grep Ping | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'` | |
DOWNLOAD=`echo "$OUTPUT" | grep Download | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'` | |
UPLOAD=`echo "$OUTPUT" | grep Upload | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'` | |
DATE=`date +%Y/%m/%d` | |
TIME=`date +%H:%M:%S` | |
echo "$DATE;$TIME;$PING;$DOWNLOAD;$UPLOAD" | tee -a /var/log/speedtest.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment