Artix Linux Forum

General Category => Discussion about Artix => Topic started by: mrbrklyn on 31 March 2025, 06:55:30

Title: Mirror ratings
Post by: mrbrklyn on 31 March 2025, 06:55:30
https://www.youtube.com/watch?v=lTdhLbFKWa4

Rate Mirrors ... this guy is not a fan, BTW
Title: Re: Mirror ratings
Post by: Wolzly on 31 March 2025, 07:16:20
Big fan of rate mirrors. Though I'm noob so maybe I'm wrong haha.

I use this script and have it called whenever pacman updates a mirrorlist via a hook:

Code: [Select]
❯ cat ratem_hook.sh
#!/usr/bin/bash

tmpfile=$(mktemp)
sudo chown user $tmpfile

if [[ "$1" == "arch" ]] then
[[ -f /etc/pacman.d/mirrorlist-arch.pacnew ]] && sudo mv /etc/pacman.d/mirrorlist-arch.pacnew /etc/pacman.d/mirrorlist-arch
sudo -u user rate-mirrors --save $tmpfile $1 && sudo cp $tmpfile /etc/pacman.d/mirrorlist-arch
elif [[ "$1" == "chaotic-aur" ]] then
[[ -f /etc/pacman.d/chaotic-mirrorlist.pacnew ]] && sudo mv /etc/pacman.d/chaotic-mirrorlist.pacnew /etc/pacman.d/chaotic-mirrorlist
sudo -u user rate-mirrors --save $tmpfile $1 && sudo cp $tmpfile /etc/pacman.d/chaotic-mirrorlist
elif [[ "$1" == "artix" ]] then
[[ -f /etc/pacman.d/mirrorlist.pacnew ]] && sudo mv /etc/pacman.d/mirrorlist.pacnew /etc/pacman.d/mirrorlist
sudo -u user rate-mirrors --save $tmpfile $1 && sudo cp $tmpfile /etc/pacman.d/mirrorlist
fi

Again, I am noob so I'm probably doing very awkward scripting things but it works so there's that :P