dotfiles

Dash Eclipse's dotfiles
git clone git://ezup.dev/dotfiles.git
Log | Files | Refs | README | LICENSE

commit 58100f9b21d12bedb08ff4ba00aa4f8a0f0affb8
parent 32378ca5c976803c4b91fc460f771865b0dd7480
Author: Dash Eclipse <dashezup@disroot.org>
Date:   Thu,  3 Jun 2021 13:31:02 +0000

feat: add voidlinux-mirror-speedtest.sh

Diffstat:
A.local/bin/voidlinux-mirror-speedtest.sh | 28++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)

diff --git a/.local/bin/voidlinux-mirror-speedtest.sh b/.local/bin/voidlinux-mirror-speedtest.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +pkg_file="glibc-2.32_2.x86_64.xbps" + + +time_appconnect() { + time_appconnect=$(curl --connect-timeout 2 -o/dev/null -sw '%{time_appconnect}' -I $1) + result=$(printf "%.3f s" $time_appconnect) + echo $result +} + +download_speed() { + speed=$(curl --progress-bar $1 -o/dev/null --write-out "%{speed_download}" | numfmt --to=iec-i --suffix=B/s) + echo $speed +} + +# https://docs.voidlinux.org/xbps/repositories/mirrors/index.html +while read -r mirror; do + pkg_url=${mirror}current/${pkg_file} + echo $pkg_url + time_appconnect $pkg_url + download_speed $pkg_url + echo +done <<_EOF +https://alpha.de.repo.voidlinux.org/ +https://mirrors.servercentral.com/voidlinux/ +https://alpha.us.repo.voidlinux.org/ +_EOF