Last active
February 24, 2020 23:01
-
-
Save dan-r95/accd65230e9bc26953bde62b6d42ccf9 to your computer and use it in GitHub Desktop.
crontab job + speedtest-cli to measure isp speed
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 | |
# schedule with crontab -e every x hours/ minutes | |
# install speedtest https://www.speedtest.net/apps/cli | |
str1="\"" | |
str2="\"," | |
FILE=/home/rossy/vodafone_speed.log | |
if [ ! -f "$FILE" ]; then # if file does not exist, create csv header | |
echo "creating file $FILE !" | |
/usr/bin/speedtest -s 2495 -f csv --output-header >> $FILE # create new file | |
fi | |
{ echo -n ${str1}; echo -n `date "+%d.%m.%Y %H:%M:%S"`; echo -n ${str2}; } >> $FILE #append date | |
/usr/bin/speedtest -s 2495 -f csv >> $FILE # append throughput |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment