summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-05-26 02:27:26 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-05-26 02:27:26 (EDT)
commit96eb9dc49107c53fdcdea36ff7f1ee46ec59f1f3 (patch)
tree42ba2d7520da6ed3f93f7981bd9cc69a33d303df /lib
parentdceee6a05ac3f71ed3b69106a1a03af688311074 (diff)
prof_proteanos_select_mirror(): Get mirrors list from files site
Diffstat (limited to 'lib')
-rw-r--r--lib/profile/proteanos.sh21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/profile/proteanos.sh b/lib/profile/proteanos.sh
index b78c5e8..92db579 100644
--- a/lib/profile/proteanos.sh
+++ b/lib/profile/proteanos.sh
@@ -81,24 +81,17 @@ prof_proteanos_default_plat()
prof_proteanos_select_mirror()
{
+ local mirrors=
+ local mirrors_count=
local rand=
- local mirror=
+ mirrors="$(wget -q -O - \
+ 'http://files.proteanos.com/pub/proteanos-mirrors-http')"
+ mirrors_count=$(printf '%s\n' "${mirrors}" | wc -l)
rand=$(date '+%S')
- rand=$(($rand % 3))
- case ${rand} in
- 0)
- mirror='http://us.mirror.gnu.dk/pub/proteanos'
- ;;
- 1)
- mirror='http://eu.mirror.gnu.dk/pub/proteanos'
- ;;
- 2)
- mirror='http://mirror.oss.maxcdn.com/proteanos'
- ;;
- esac
+ rand=$(($rand % $mirrors_count + 1))
- printf '%s\n' "${mirror}"
+ printf '%s\n' "${mirrors}" | sed -n "${rand}p"
}
prof_proteanos_validate_archplat()