Browse Source

sde-download: only accept mirrors returning 200 to the test

stable/0.3
Alejandro Mery 12 years ago
parent
commit
a5d6bd516e
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      lib/sde-download/mirror-test.sh

+ 3
- 4
lib/sde-download/mirror-test.sh

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/sde-download/mirror-test.sh
# Copyright (C) 2006 - 2010 The OpenSDE Project
# Copyright (C) 2006 - 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
@ -47,9 +47,8 @@ while read name country admin url ; do
# test
echo -n "Testing <$name> ($country) ..." 1>&2
speed="$(curl -s -m 20 "$url/DOWNTEST" -w "%{speed_download}" -o /dev/null |
sed -e 's:,:.:' -e 's:[\.,]...$::' )"
speed=$(curl -s -m 20 "$url/DOWNTEST" -w "%{http_code} %{speed_download}" -o /dev/null |
grep '^200 ' | cut -d' ' -f2- | sed -e 's:,:.:' -e 's:[\.,]...$::')
# compare
if [ "${speed:-0}" = "0" ]; then
echo ' failed' 1>&2

Loading…
Cancel
Save