#!/usr/bin/env bash set -e echo "=================================" echo " Liara Debian Mirror Setup" echo "=================================" # Check OS if [[ ! -f /etc/os-release ]]; then echo "Cannot detect OS. /etc/os-release not found." exit 1 fi source /etc/os-release if [[ "$ID" != "debian" ]]; then echo "This script is only for Debian." echo "Detected OS: $ID" exit 1 fi CODENAME="$VERSION_CODENAME" if [[ -z "$CODENAME" ]]; then echo "Could not detect Debian codename." exit 1 fi echo "Detected Debian codename: $CODENAME" echo echo "[1/4] Backing up current APT sources..." cp /etc/apt/sources.list /etc/apt/sources.list.bak echo echo "[2/4] Writing Liara mirrors to /etc/apt/sources.list..." cat > /etc/apt/sources.list <