aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2023-01-04 17:23:39 +0800
committerGuangxiong Lin <[email protected]>2023-01-04 17:23:39 +0800
commit9662a8ec581ea6055d1bfaff3ba4dd6602bddccd (patch)
tree82d350423651707f673f41b7f32d3c0f7d30d419
parent92d606863e5d9fe423dd602a069a55409d10fd42 (diff)
downloaddotfiles-9662a8ec581ea6055d1bfaff3ba4dd6602bddccd.tar.gz
dotfiles-9662a8ec581ea6055d1bfaff3ba4dd6602bddccd.tar.bz2
dotfiles-9662a8ec581ea6055d1bfaff3ba4dd6602bddccd.zip
Add update-mirrors script
-rwxr-xr-xscripts/update-mirrors.sh6
1 files changed, 6 insertions, 0 deletions
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