add speed test
This commit is contained in:
parent
25b94c17dc
commit
296c0701c1
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
EMAIL="YOUR_EMAIL@example.com"
|
||||||
|
NAME="speedtest"
|
||||||
|
EVENT="finished"
|
||||||
|
OUTPUT=/tmp/wget.speedtest
|
||||||
|
|
||||||
|
TEST_FILES=(
|
||||||
|
https://node1.example.com/10meg.test
|
||||||
|
https://node2.example.com/10meg.test
|
||||||
|
https://node3.example.com/10meg.test
|
||||||
|
https://node4.example.com/10meg.test
|
||||||
|
https://node5.example.com/10meg.test
|
||||||
|
)
|
||||||
|
|
||||||
|
# speed test
|
||||||
|
if [ -f $OUTPUT ]; then
|
||||||
|
rm $OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
for file in ${TEST_FILES[@]}; do
|
||||||
|
timeout 5 wget -4 -O /dev/null $file -a $OUTPUT
|
||||||
|
echo -e "\n\n#######################\n" >>$OUTPUT
|
||||||
|
done
|
||||||
|
|
||||||
|
# send email
|
||||||
|
curl -s --http1.0 https://www.xdty.org/mail_extra.php -X POST -d "event=$EVENT&name=$NAME&email=$EMAIL" --data-urlencode extra@$OUTPUT --capath /etc/ssl/certs/
|
Loading…
Reference in New Issue