Last active
May 5, 2016 19:43
-
-
Save angelbladex/d1b27db7f04a36a737f9a1ea6e64086b to your computer and use it in GitHub Desktop.
Determinate 6 fasterst mirrors for ArchLinux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
limit=6 | |
file="/tmp/mirrorlist.pacnew" | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
cp /etc/pacman.d/mirrorlist.pacnew | |
sed -i 's/^#Server/Server/' $file | |
rankmirrors -n $limit $file > /etc/pacman.d/mirrorlist | |
echo "Task executed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment