mirror of
https://github.com/Snigdha-OS/snigdhaos-system-config.git
synced 2025-09-20 19:44:58 +02:00
⚡️ perf(improve): system's speed and the number of mirrors being tested, you can adjust the --concurrency parameter
This commit is contained in:
@@ -1,12 +1,33 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Define function to check if rate-mirrors is installed
|
||||||
|
check_dependencies() {
|
||||||
|
if ! command -v /usr/bin/rate-mirrors &>/dev/null; then
|
||||||
|
echo "Error: rate-mirrors is not installed. Please install it first."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check for rate-mirrors dependency
|
||||||
|
check_dependencies
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Getting Fastest Mirror..."
|
echo "Getting Fastest Mirror..."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
sudo /usr/bin/rate-mirrors --concurrency 40 --disable-comments --allow-root --save /etc/pacman.d/mirrorlist arch
|
# Run rate-mirrors for the Arch and Chaotic-AUR repositories
|
||||||
sudo /usr/bin/rate-mirrors --concurrency 40 --disable-comments --allow-root --save /etc/pacman.d/chaotic-mirrorlist chaotic-aur
|
echo "Finding fastest mirrors for Arch..."
|
||||||
|
if ! sudo /usr/bin/rate-mirrors --concurrency 40 --disable-comments --allow-root --save /etc/pacman.d/mirrorlist arch; then
|
||||||
|
echo "Error: Failed to update the Arch mirrorlist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Finding fastest mirrors for Chaotic-AUR..."
|
||||||
|
if ! sudo /usr/bin/rate-mirrors --concurrency 40 --disable-comments --allow-root --save /etc/pacman.d/chaotic-mirrorlist chaotic-aur; then
|
||||||
|
echo "Error: Failed to update the Chaotic-AUR mirrorlist."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Fastest mirrors have been set..."
|
echo "Fastest mirrors have been set for both Arch and Chaotic-AUR."
|
||||||
echo
|
echo
|
||||||
|
Reference in New Issue
Block a user