From 10597f76f67c51dd332cc49fb91cd082fb3c47d1 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Sun, 29 Nov 2015 19:56:42 +0800 Subject: [PATCH] Add 300s timeout --- bench.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench.sh b/bench.sh index 4be8b73..050e705 100644 --- a/bench.sh +++ b/bench.sh @@ -18,7 +18,7 @@ next() { } speed_test() { - speedtest=$(wget -4O /dev/null $1 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}') + speedtest=$(wget -4O /dev/null -T300 $1 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}') ipaddress=$(ping -c1 -n `awk -F'/' '{print $3}' <<< $1` | awk -F'[()]' '{print $2;exit}') nodeName=$2 if [ "${#nodeName}" -lt "8" ]; then @@ -33,7 +33,7 @@ speed_test() { } speed_test_v6() { - speedtest=$(wget -6O /dev/null $1 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}') + speedtest=$(wget -6O /dev/null -T300 $1 2>&1 | awk '/\/dev\/null/ {speed=$3 $4} END {gsub(/\(|\)/,"",speed); print speed}') ipaddress=$(ping6 -c1 -n `awk -F'/' '{print $3}' <<< $1` | awk -F'[()]' '{print $2;exit}') nodeName=$2 if [ "${#nodeName}" -lt "8" -a "${#ipaddress}" -eq "13" ]; then