The code in mirrorselect for doing a deep check looks like this: STIME=$(date) wget .... ETIME=$(date) [ $? == 0] && echo stuff > tmpfile What is intended, I'm sure, by the [ $? == 0 ] guard is to only include those hosts who successfully downloaded the file. However, what $? is really checking is the return code of date. Whoops! The end result is that, non-existent hosts, which fail DNS lookup immediately, are considered "fast". The code should instead look like this: STIME=$(date) wget .... RESULT=$? ETIME=$(date) [ $RESULT == 0] && echo stuff > tmpfile I've tested this locally to good effect. Reproducible: Always Steps to Reproduce:
Im sure this is how you said it should be, as I'm sure I corrected this before I comitted. will revisit later and correct where neccessary. thanks.
this is from 0.89 YCOUNT=0 for i in ${CHECKLIST} do YCOUNT=$((${YCOUNT}+1)) PERCENT=$(((${YCOUNT}*100)/${COUNT})) print_percent "${PERCENT}" "${i}" STIME=$(date +%s%N) wget -t 1 -C off -T ${TIMEOUT} -O /dev/null - ${i}/distfiles/mirrorselect-test 2>/dev/null RESULT=${?} ETIME=$(date +%s%N) [ ${RESULT} == 0 ] && $(echo "$((${ETIME}-${STIME})) ${RESULT} ${i}" >> ${TMPFILE}) done echo "Sorting by speed " >&2 MIRRORS="$(sort -g < ${TMPFILE} | cut -f3- -d" " | head -n ${SERVERS})" Could you please retest with this version and feed me back your results. Cheers.