From 9662a8ec581ea6055d1bfaff3ba4dd6602bddccd Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Wed, 4 Jan 2023 17:23:39 +0800 Subject: Add update-mirrors script --- scripts/update-mirrors.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 scripts/update-mirrors.sh (limited to 'scripts/update-mirrors.sh') diff --git a/scripts/update-mirrors.sh b/scripts/update-mirrors.sh new file mode 100755 index 0000000..4fa9a50 --- /dev/null +++ b/scripts/update-mirrors.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +countrys="country=CN" + +sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup +curl -s "https://archlinux.org/mirrorlist/?$countrys&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 5 - | sudo tee /etc/pacman.d/mirrorlist -- cgit v1.2.3