Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt-get install python-pip
- pip install speedtest-cli
- git clone https://github.com/HenrikBengtsson/speedtest-cli-extras.git
- cd speedtest-cli-extras/bin
- mv speedtest-csv ../../speedtest-start
- cd ../..
- rm -rf speedtest-cli-extras
- vim speedtest-start
- # Output CSV results
- #sep="$quote$sep$quote"
- #printf "$quote$start$sep$stop$sep$from$sep$from_ip$sep$server$sep$server_dist$sep$server_ping$sep$download$sep$upload$sep$share_url$quote\n"
- # Output
- #sep="$quote$sep$quote"
- dateday=$(date +"%d.%m.%Y")
- datetime=$(date +"%H:%M")
- printf "$dateday;$datetime;$server_ping;$download;$upload\n"
- #printf "ping: $server_ping\n"
- #printf "download: $download\n"
- #printf "upload: $upload\n"
- # Send to IFTTT
- secret_key="SECRET KEY"
- value1=`echo $server_ping | cut -d" " -f1`
- value2=`echo $download | cut -d" " -f1`
- value3=`echo $upload | cut -d" " -f1`
- json="{\"value1\":\"'${value1}\",\"value2\":\"'${value2}\",\"value3\":\"'${value3}\"}"
- curl -X POST -H "Content-Type: application/json" -d "${json}" https://maker.ifttt.com/trigger/speedtest/with/key/${secret_key} >> /dev/null
- crontab -e
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- 0,30 * * * * cd /disque_externe/speedtest && ./speedtest-start >> /disque_externe/speedtest/speedtest.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement