summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Bilyk <jbilyk@gmail.com>2011-02-26 21:40:14 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2011-02-26 21:55:06 -0600
commitf7b18f26778cf51dccea661a545fa4add662e7ae (patch)
tree95d22b36897c03b565e55034c819065460178b95
parent325534f013c9b1a46d7587048f913a1984c46802 (diff)
downloadalpine-conf-f7b18f26778cf51dccea661a545fa4add662e7ae.tar.bz2
alpine-conf-f7b18f26778cf51dccea661a545fa4add662e7ae.tar.xz
remove bind-tools dependency
nslookup statement needed bind-tools version of nslookup, not busybox
-rwxr-xr-xsetup-apkrepos.in24
1 files changed, 10 insertions, 14 deletions
diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index dd991a1..3719bdb 100755
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -64,23 +64,19 @@ get_fastest_mirror() {
mirror_lowest_rtt=-1
for mirror in $MIRRORS; do
mirror_hostname=`echo $mirror | awk -F '://' '{print $2}' | awk -F '/' '{print $1}'`
- tmp_mirror_nslookup=`nslookup $mirror_hostname | grep "Non-authoritative answer"`
- if [ ${#tmp_mirror_nslookup} -gt 0 ]; then
- tmp_mirror_time="`(time wget -qO - $mirror) 2>&1 || echo "E_MIRROR_FAILED"`"
- tmp_mirror_time_failed=`echo $tmp_mirror_time | grep "E_MIRROR_FAILED"`
- if [ ${#tmp_mirror_time_failed} -eq 0 ]; then
- tmp_mirror_rtt=`echo "$tmp_mirror_time" | grep -E "^real" | sed -r "s/^real[ ]+[0-9]+m[ ]+([0-9]+)\.([0-9]+)s$/\1\2/"`
-
- if [ $mirror_lowest_rtt -eq -1 ]; then
+ tmp_mirror_time="`(time wget -qO - $mirror) 2>&1 || echo "E_MIRROR_FAILED"`"
+ tmp_mirror_time_failed=`echo $tmp_mirror_time | grep "E_MIRROR_FAILED"`
+ if [ ${#tmp_mirror_time_failed} -eq 0 ]; then
+ tmp_mirror_rtt=`echo "$tmp_mirror_time" | grep -E "^real" | sed -r "s/^real[ ]+[0-9]+m[ ]+([0-9]+)\.([0-9]+)s$/\1\2/"`
+ if [ $mirror_lowest_rtt -eq -1 ]; then
+ mirror_lowest_rtt=$tmp_mirror_rtt
+ mirror_lowest_rtt_hostname=$mirror_hostname
+ mirror_lowest_rtt_mirror=$mirror
+ else
+ if [ $tmp_mirror_rtt -lt $mirror_lowest_rtt ]; then
mirror_lowest_rtt=$tmp_mirror_rtt
mirror_lowest_rtt_hostname=$mirror_hostname
mirror_lowest_rtt_mirror=$mirror
- else
- if [ $tmp_mirror_rtt -lt $mirror_lowest_rtt ]; then
- mirror_lowest_rtt=$tmp_mirror_rtt
- mirror_lowest_rtt_hostname=$mirror_hostname
- mirror_lowest_rtt_mirror=$mirror
- fi
fi
fi
fi