rankmirrors
This commit is contained in:
parent
fb06c9e19b
commit
a6755863dd
6 changed files with 28 additions and 4 deletions
21
config/scripts/arch-rankmirrors
Executable file
21
config/scripts/arch-rankmirrors
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ $USER != root ]
|
||||
then
|
||||
echo "This script should be run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! pacman -Qq pacman-mirrorlist &> /dev/null
|
||||
then
|
||||
pacman -S pacman-mirrorlist
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/pacman.d/mirrorlist.pacnew ]
|
||||
then
|
||||
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacnew
|
||||
fi
|
||||
|
||||
egrep -o 'Server = .+' /etc/pacman.d/mirrorlist.pacnew | /usr/bin/rankmirrors -n 6 - > /etc/pacman.d/mirrorlist
|
Loading…
Add table
Add a link
Reference in a new issue