Advertisement
Guest User

Untitled

a guest
Apr 11th, 2021
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #test ping of arch mirror
  2. #usage: mping \.nz
  3. mping()
  4. {
  5.     local REPLY p q
  6.     q="${1:-\.br}"
  7.  
  8.     echo "query: $q"
  9.     sed -nE "/$q/ s|.*//([^/]*).*|\1|p" /etc/pacman.d/mirrorlist |
  10.         sort -u | tee >( echo "servs: $(wc -l)" ) |
  11.         while read
  12.         do
  13.             echo ----
  14.             p="$(ping -c 1 "$REPLY" | grep -o --color=always 'time=.*' | tee >(read x ;echo -e "$x\t$REPLY" >&2) )"
  15.             printf '%s\t%s\n' "$p" "$REPLY"
  16.         done | sort -Vru
  17. }
  18. #{ 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