From 416a03cb10c3161dd57266ce6884c1901d6544c8 Mon Sep 17 00:00:00 2001 From: tianyu Date: Mon, 20 Jul 2015 10:54:52 +0800 Subject: [PATCH] Create README.md --- speedtest/README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 speedtest/README.md diff --git a/speedtest/README.md b/speedtest/README.md new file mode 100644 index 0000000..47ef9d8 --- /dev/null +++ b/speedtest/README.md @@ -0,0 +1,49 @@ +This script can do a speedtest to servers and then send the result to your email, you can add this to crontab. + +###openwrt dependency + +This script are using `curl` `wget` `timeout` and `https`. If you're using this on openwrt router, you need to do the following commands + +``` +opkg update +opkg install coreutils-timeout +opkg install ca-certificates +opkg install curl +opkg install wget +``` + +###How to use + +**1\. Get the script from github** +``` +cd ~/bin +wget https://raw.githubusercontent.com/xdtianyu/scripts/master/speedtest/speedtest.sh -O speedtest +chmod +x speedtest +``` +You can add `~/bin` to your `PATH` in `/etc/profile` + +**2\. Script configuration** + +Replace `EMAIL` with your email address. + +Replace `TEST_FILES` arrays with your own test files. Each test will only has 5 seconds and then `timeout`. + +You can replace `NAME` with `speedtest(home)` to distinguish other tests. + +**3\. Do a speedtest** + +``` +~/bin/speedtest +``` +Then check your email for result. + +**4\. Add to `crontab`** + + +``` +crontab -e + +25 * * * * /root/bin/speedtest +``` + +This means at every hour's 25, a speedtest runs and you get a result email.