Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #test ping of arch mirror
- #usage: mping \.nz
- mping()
- {
- local REPLY p q
- q="${1:-\.br}"
- echo "query: $q"
- sed -nE "/$q/ s|.*//([^/]*).*|\1|p" /etc/pacman.d/mirrorlist |
- sort -u | tee >( echo "servs: $(wc -l)" ) |
- while read
- do
- echo ----
- p="$(ping -c 1 "$REPLY" | grep -o --color=always 'time=.*' | tee >(read x ;echo -e "$x\t$REPLY" >&2) )"
- printf '%s\t%s\n' "$p" "$REPLY"
- done | sort -Vru
- }
- #{ curl --compressed -L https://www.archlinux.org/mirrors/status/json/ | jq '.urls[]|select(.country=="Brazil")' ;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement