Advertisement
Guduche

Tuto speedtest

Aug 10th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. apt-get install python-pip
  2. pip install speedtest-cli
  3. git clone https://github.com/HenrikBengtsson/speedtest-cli-extras.git
  4. cd speedtest-cli-extras/bin
  5. mv speedtest-csv ../../speedtest-start
  6. cd ../..
  7. rm -rf speedtest-cli-extras
  8. vim speedtest-start
  9.  
  10.  
  11. # Output CSV results
  12. #sep="$quote$sep$quote"
  13. #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"
  14.  
  15. # Output
  16. #sep="$quote$sep$quote"
  17. dateday=$(date +"%d.%m.%Y")
  18. datetime=$(date +"%H:%M")
  19. printf "$dateday;$datetime;$server_ping;$download;$upload\n"
  20. #printf "ping: $server_ping\n"
  21. #printf "download: $download\n"
  22. #printf "upload: $upload\n"
  23.  
  24. # Send to IFTTT
  25. secret_key="SECRET KEY"
  26. value1=`echo $server_ping | cut -d" " -f1`
  27. value2=`echo $download | cut -d" " -f1`
  28. value3=`echo $upload | cut -d" " -f1`
  29. json="{\"value1\":\"'${value1}\",\"value2\":\"'${value2}\",\"value3\":\"'${value3}\"}"
  30. curl -X POST -H "Content-Type: application/json" -d "${json}" https://maker.ifttt.com/trigger/speedtest/with/key/${secret_key} >> /dev/null
  31.  
  32.  
  33. crontab -e
  34.  
  35.  
  36. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  37. 0,30 * * * * cd /disque_externe/speedtest && ./speedtest-start >> /disque_externe/speedtest/speedtest.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement