gluon-autoupdater: Randomize mirror order

This way we have a kind of load balancing among the mirrors.
This commit is contained in:
Nils Schneider 2014-01-21 00:19:13 +01:00 committed by Daniel Ehlers
parent 5060dd95eb
commit 8c0188a4f6
1 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,9 @@ if test "a$1" != "a-f"; then
fi
BRANCH_NAME=$(uci get autoupdater.${BRANCH}.name)
MIRRORS=$(uci get autoupdater.${BRANCH}.mirror)
MIRRORS=$(for mirror in $(uci get autoupdater.${BRANCH}.mirror); do \
hexdump -n1 -e '/1 "%d '"$mirror"'\n"' /dev/urandom; \
done | sort -n | cut -d' ' -f2)
PUBKEYS=$(uci get autoupdater.${BRANCH}.pubkey)
GOOD_SIGNATURES=$(uci get autoupdater.${BRANCH}.good_signatures)