forked from Interanet/server-bootstrap
27 lines
637 B
Bash
27 lines
637 B
Bash
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
echo "================================="
|
|
echo " Runflare Arch Mirror Setup"
|
|
echo "================================="
|
|
|
|
if [[ ! -f /etc/arch-release ]]; then
|
|
echo "This script only supports Arch Linux."
|
|
exit 1
|
|
fi
|
|
|
|
echo "[1/3] Backing up mirrorlist..."
|
|
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
|
|
|
|
echo "[2/3] Commenting existing mirrors..."
|
|
sed -i 's/^Server/#Server/g' /etc/pacman.d/mirrorlist
|
|
|
|
echo "[3/3] Adding Runflare mirror..."
|
|
|
|
echo "Server = http://mirror-linux.runflare.com/archlinux/\$repo/os/\$arch" \
|
|
>> /etc/pacman.d/mirrorlist
|
|
|
|
pacman -Syyu
|
|
|
|
echo "Arch mirror configured."
|