Created
November 8, 2020 20:36
-
-
Save sksat/b3746d62223e6f92f17aae43159fec0f to your computer and use it in GitHub Desktop.
speed.sh
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 | |
#/usr/bin/speedtest --server 15047 --csv >> /home/sksat/speed/`date -u "+%Y-%m-%d"`.csv | |
line=`/usr/bin/speedtest --server 15047 --csv` | |
csv=() | |
for ((i=1; i < 11; i++)); do | |
a=`echo ${line} | cut -d ',' -f ${i}` | |
#echo $a | |
csv=("${csv[@]}" "$a") | |
done | |
timestamp=${csv[3]} | |
csv[3]=`date -d $timestamp '+%Y-%m-%d-%H:%M:%S'` | |
out=`echo -n ${csv[0]}` | |
for ((i=1; i < 10; i++)); do | |
out=$out`echo -n ','${csv[i]}` | |
done | |
echo $out >> /home/sksat/speed/`date "+%Y-%m-%d"`.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment