summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2015-05-26 02:30:32 (EDT)
committer P. J. McDermott <pj@pehjota.net>2015-05-26 02:30:32 (EDT)
commit5f2b0a2b8001aa37a6abda2a5b4982ed64c4d434 (patch)
tree6d75972f48af47922df7a49f497712a2c7566289 /lib
parent96eb9dc49107c53fdcdea36ff7f1ee46ec59f1f3 (diff)
prof_proteanos_select_mirror(): Use rand()
Diffstat (limited to 'lib')
-rw-r--r--lib/profile/proteanos.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/profile/proteanos.sh b/lib/profile/proteanos.sh
index 92db579..272282a 100644
--- a/lib/profile/proteanos.sh
+++ b/lib/profile/proteanos.sh
@@ -18,6 +18,7 @@
# along with the ProteanOS Development Kit. If not, see
# <http://www.gnu.org/licenses/>.
+use rand
use opkg
prof_proteanos_fstab_linux="\
@@ -83,15 +84,15 @@ prof_proteanos_select_mirror()
{
local mirrors=
local mirrors_count=
- local rand=
+ local mirror_num=
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 % $mirrors_count + 1))
+ rand
+ mirror_num=$(($rand_x % $mirrors_count + 1))
- printf '%s\n' "${mirrors}" | sed -n "${rand}p"
+ printf '%s\n' "${mirrors}" | sed -n "${mirror_num}p"
}
prof_proteanos_validate_archplat()