From 8c0188a4f6670dd8f1867e92b2f5f7c952652f51 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 21 Jan 2014 00:19:13 +0100 Subject: [PATCH] gluon-autoupdater: Randomize mirror order This way we have a kind of load balancing among the mirrors. --- gluon/gluon-autoupdater/files/usr/sbin/autoupdater | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gluon/gluon-autoupdater/files/usr/sbin/autoupdater b/gluon/gluon-autoupdater/files/usr/sbin/autoupdater index 5e351b4..88e6434 100755 --- a/gluon/gluon-autoupdater/files/usr/sbin/autoupdater +++ b/gluon/gluon-autoupdater/files/usr/sbin/autoupdater @@ -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)