1 Star 0 Fork 0

等风也等你/debian-on-termux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
list_close_debian_mirrors.sh 477 Bytes
一键复制 编辑 原始数据 按行查看 历史
Tim 提交于 2020-07-24 13:42 . Create list_close_debian_mirrors.sh
#!/bin/bash
#
# list_close_debian_mirrors.sh
#
simpleping(){
URL="$1"
D="$(echo "$URL" \
| perl -pe 's/.*\/\///g;s/\/.*//g')"
{
ping -c 1 -W 1 "$D" \
| grep "time=" \
| perl -pe 's/.*time=//g;s/\n/\t/g'
echo "$URL"
} | grep .
}
export -f simpleping
curl -s https://www.debian.org/mirror/list \
| grep http \
| grep "debian/</a>" \
| perl -pe 's/.*"(http)/$1/g;s/".*//g' \
| xargs -I {} -P 99 bash -c "simpleping '{}'" \
| grep " ms" \
| sort -n \
| head
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jiangsy163/debian-on-termux.git
git@gitee.com:jiangsy163/debian-on-termux.git
jiangsy163
debian-on-termux
debian-on-termux
master

搜索帮助