31 lines
700 B
Bash
31 lines
700 B
Bash
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
echo "================================="
|
|
echo " Runflare Debian Mirror Setup"
|
|
echo "================================="
|
|
|
|
source /etc/os-release
|
|
|
|
if [[ "$ID" != "debian" ]]; then
|
|
echo "This script only supports Debian."
|
|
exit 1
|
|
fi
|
|
|
|
CODENAME=$(lsb_release -cs)
|
|
|
|
echo "[1/3] Backing up sources.list..."
|
|
cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
|
|
|
echo "[2/3] Writing Runflare mirror..."
|
|
|
|
tee /etc/apt/sources.list > /dev/null <<EOF
|
|
deb http://mirror-linux.runflare.com/debian $CODENAME main
|
|
deb http://mirror-linux.runflare.com/debian-security ${CODENAME}-security main
|
|
EOF
|
|
|
|
echo "[3/3] Updating package index..."
|
|
apt update
|
|
|
|
echo "Debian mirror configured."
|