|
@@ -322,6 +322,12 @@ function fastest_url() {
|
|
fastest_time=0
|
|
fastest_time=0
|
|
|
|
|
|
for url in "${urls[@]}"; do
|
|
for url in "${urls[@]}"; do
|
|
|
|
+ if curl --output /dev/null --silent --head --fail "$url"; then
|
|
|
|
+ echo $url" is available"
|
|
|
|
+ else
|
|
|
|
+ echo $url" is not available"
|
|
|
|
+ continue
|
|
|
|
+ fi
|
|
time=$(curl --connect-timeout 3 -s -w '%{time_total}\n' -o /dev/null $url)
|
|
time=$(curl --connect-timeout 3 -s -w '%{time_total}\n' -o /dev/null $url)
|
|
if (( $(echo "$time < $fastest_time || $fastest_time == 0" | bc -l) )); then
|
|
if (( $(echo "$time < $fastest_time || $fastest_time == 0" | bc -l) )); then
|
|
fastest_time=$time
|
|
fastest_time=$time
|