mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Add 300s timeout
This commit is contained in:
parent
f55ee03877
commit
10597f76f6
4
bench.sh
4
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user