Created
January 20, 2017 03:34
-
-
Save u8sand/de1c13a66e1ab65a18777dbe4621c973 to your computer and use it in GitHub Desktop.
Script for ranking the mirrorlist.pacnew files that are updated every once in a while.
This file contains hidden or 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 | |
| if [ $(id -u) != 0 ]; then | |
| exec sudo -- "$0" "$@" | |
| else | |
| cat /etc/pacman.d/mirrorlist.pacnew | awk -v RS='\n\n' '/^## United States/{print $0}' | awk '/^#Server/{print substr($0, 2)}' | rankmirrors - > /etc/pacman.d/mirrorlist | |
| rm /etc/pacman.d/mirrorlist.pacnew | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment