initial commit

This commit is contained in:
2026-03-18 03:29:25 +08:00
commit 146c2c5f35
37 changed files with 1445 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -e
echo "================================="
echo " Liara Alpine Mirror Setup"
echo "================================="
if [[ ! -f /etc/alpine-release ]]; then
echo "This script only supports Alpine Linux."
exit 1
fi
echo
echo "[1/3] Backing up repositories..."
cp /etc/apk/repositories /etc/apk/repositories.bak
echo
echo "[2/3] Detecting Alpine version..."
ALPINE_VERSION=$(cut -d'.' -f1,2 /etc/alpine-release)
echo "Detected Alpine version: $ALPINE_VERSION"
echo
echo "[3/3] Writing Liara mirror..."
cat > /etc/apk/repositories <<EOF
https://linux-mirror.liara.ir/repository/alpine/v${ALPINE_VERSION}/main
https://linux-mirror.liara.ir/repository/alpine/v${ALPINE_VERSION}/community
EOF
echo
echo "Updating package index..."
apk update
echo
echo "Alpine mirror configured successfully."