Commit b36ecbc7 authored by Katie Holly's avatar Katie Holly Committed by Natanael Copa

setup-apkrepos: Allow the script to pick a server with 0.00sec download time and

replaced the awk script with tee-sort-head-cut magic
parent 50c34a98
......@@ -57,19 +57,7 @@ find_fastest_mirror() {
if [ -n "$time" ]; then
echo "$time $url"
fi
done | awk ' {
if (!current) {
current=$1
url=$2
} else {
if ($1 < current) {
current=$1
url=$2
}
}
printf("%6.2f %s\n", $1, $2) > "/dev/stderr"
}
END { print url }'
done | tee /dev/stderr | sort -nk1,1 | head -n1 | cut -d' ' -f2
}
add_fastest_mirror() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment