Add 300s timeout

This commit is contained in:
Teddysun 2015-11-29 19:56:42 +08:00
parent f55ee03877
commit 10597f76f6

View File

@ -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