3 RSYNC="rsync -4 --contimeout 5 --no-motd --list-only"
5 # try to choose close ubuntu mirror which support rsync protocol
6 # https://bugs.launchpad.net/fuel/+bug/1459252
8 # A minor modificiation of Michal Skalski's original Makefile version
9 # to only consider repos where no repo updates are in progress (as
10 # that may have us hanging quite a while otherwise). If no suitable
11 # local mirror can be found after four attempts, the default archive
12 # is returned instead.
17 for url in $(curl -s http://mirrors.ubuntu.com/mirrors.txt)
19 host=$(echo $url | cut -d'/' -f3)
20 if $RSYNC "${host}::ubuntu/." &> /dev/null
22 if ! $RSYNC "${host}::ubuntu/Archive-Update-in-Progress*" &> /dev/null
32 echo "archive.ubuntu.com"