forked from Interanet/server-bootstrap
29 lines
661 B
Bash
29 lines
661 B
Bash
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
echo "================================="
|
|
echo " Runflare Alpine Mirror Setup"
|
|
echo "================================="
|
|
|
|
if [[ ! -f /etc/alpine-release ]]; then
|
|
echo "This script only supports Alpine."
|
|
exit 1
|
|
fi
|
|
|
|
VERSION="v$(cut -d'.' -f1,2 /etc/alpine-release)"
|
|
|
|
echo "[1/3] Backing up repositories..."
|
|
cp /etc/apk/repositories /etc/apk/repositories.bak
|
|
|
|
echo "[2/3] Writing mirror..."
|
|
|
|
cat > /etc/apk/repositories <<EOF
|
|
http://mirror-linux.runflare.com/alpine/$VERSION/main
|
|
http://mirror-linux.runflare.com/alpine/$VERSION/community
|
|
EOF
|
|
|
|
echo "[3/3] Updating package index..."
|
|
apk update
|
|
|
|
echo "Alpine mirror configured."
|