Skip to content

Instantly share code, notes, and snippets.

@angelbladex
Last active May 5, 2016 19:43
Show Gist options
  • Save angelbladex/d1b27db7f04a36a737f9a1ea6e64086b to your computer and use it in GitHub Desktop.
Save angelbladex/d1b27db7f04a36a737f9a1ea6e64086b to your computer and use it in GitHub Desktop.
Determinate 6 fasterst mirrors for ArchLinux
#!/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