Skip to content

Commit

Permalink
rankmirrors parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
biocoderh committed Oct 11, 2023
1 parent 9416828 commit 6837fb0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .scripts/arch/rankmirrors-update
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#!/bin/sh -e

PACKAGES=""

if ! [ -x "$(command -v rankmirrors)" ]; then
sudo pacman -Sy --noconfirm --needed pacman-contrib
PACKAGES="$PACKAGES pacman-contrib"
fi

if ! [ -x "$(command -v parallel)" ]; then
PACKAGES="$PACKAGES parallel"
fi

if [ "$PACKAGES" != "" ]; then
sudo pacman -Sy --noconfirm --needed "$PACKAGES"
fi

SOURCE="https://archlinux.org/mirrorlist/?protocol=https&use_mirror_status=on"
echo "Using source: $SOURCE"

echo "Starting rankmirrors, it can take a while"
curl -s "$SOURCE" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors - | sudo tee /etc/pacman.d/mirrorlist
curl -s "$SOURCE" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -p - | sudo tee /etc/pacman.d/mirrorlist

echo "rankmirrors-update done."

0 comments on commit 6837fb0

Please sign in to comment.