set_repos.sh aktualisiert
This commit is contained in:
91
set_repos.sh
91
set_repos.sh
@@ -1,22 +1,20 @@
|
||||
#!/bin/bash
|
||||
# =====================================================
|
||||
# Proxmox VE 9 Repository Setup
|
||||
# Proxmox VE 9 Repository Setup (No-Subscription)
|
||||
# Debian 13 (trixie) | deb822 (.sources)
|
||||
# Enterprise -> No-Subscription
|
||||
# =====================================================
|
||||
|
||||
# Farben / Layout (Community-Style)
|
||||
# Farben / Layout
|
||||
BOLD="\033[1m"
|
||||
GREEN="\033[32m"
|
||||
YELLOW="\033[33m"
|
||||
RED="\033[31m"
|
||||
CYAN="\033[36m"
|
||||
RESET="\033[0m"
|
||||
INDENT=" "
|
||||
|
||||
# Root-Check
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo -e "${RED}${INDENT}Bitte als Root ausführen!${RESET}"
|
||||
echo -e "${INDENT}${BOLD}Bitte als Root ausführen!${RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -27,88 +25,61 @@ echo -e "${INDENT} No-Subscription | deb822 Standard"
|
||||
echo -e "${INDENT}=============================================="
|
||||
echo -e "${RESET}"
|
||||
|
||||
# OS-Check (PVE9 = Debian 13)
|
||||
if ! grep -q "trixie" /etc/os-release; then
|
||||
echo -e "${RED}${INDENT}Dieses Script ist NUR für Proxmox VE 9 (Debian 13)!${RESET}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Backup-Ordner
|
||||
BACKUP_DIR="/root/repo-backup-$(date +%F-%H%M)"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
echo -e "${CYAN}${INDENT}==> Backup vorhandener Repo-Dateien...${RESET}"
|
||||
|
||||
# Alte Repos sichern
|
||||
[ -f /etc/apt/sources.list ] && mv /etc/apt/sources.list "$BACKUP_DIR/"
|
||||
mv /etc/apt/sources.list.d/*.list "$BACKUP_DIR/" 2>/dev/null
|
||||
mv /etc/apt/sources.list.d/*.sources "$BACKUP_DIR/" 2>/dev/null
|
||||
|
||||
echo -e "${GREEN}${INDENT}Backup erstellt unter: $BACKUP_DIR${RESET}"
|
||||
|
||||
# Proxmox Keyring prüfen
|
||||
KEYRING="/usr/share/keyrings/proxmox-archive-keyring.gpg"
|
||||
if [[ ! -f "$KEYRING" ]]; then
|
||||
echo -e "${CYAN}${INDENT}==> Proxmox Keyring fehlt – installiere...${RESET}"
|
||||
echo -e "${INDENT}==> Proxmox Keyring fehlt – installiere..."
|
||||
apt update >/dev/null
|
||||
apt install -y proxmox-archive-keyring
|
||||
fi
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Ceph Codename ermitteln (Major -> Codename)
|
||||
# PVE Repos
|
||||
# -----------------------------------------------------
|
||||
CEPH_CODENAME="squid" # Default für PVE9
|
||||
|
||||
if command -v ceph >/dev/null 2>&1; then
|
||||
CEPH_MAJOR=$(ceph -v | awk '{print $3}' | cut -d. -f1)
|
||||
# pve-enterprise.disabled
|
||||
cat <<EOF > /etc/apt/sources.list.d/pve-enterprise.sources
|
||||
Types: deb
|
||||
URIs: https://enterprise.proxmox.com/debian/pve
|
||||
Suites: trixie
|
||||
Components: pve-enterprise
|
||||
Signed-By: ${KEYRING}
|
||||
Enabled: false
|
||||
EOF
|
||||
|
||||
case "$CEPH_MAJOR" in
|
||||
16) CEPH_CODENAME="pacific" ;;
|
||||
17) CEPH_CODENAME="quincy" ;;
|
||||
18) CEPH_CODENAME="reef" ;;
|
||||
19) CEPH_CODENAME="squid" ;;
|
||||
*)
|
||||
echo -e "${YELLOW}${INDENT}Unbekannte Ceph-Version ($CEPH_MAJOR), nutze 'squid'${RESET}"
|
||||
CEPH_CODENAME="squid"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo -e "${CYAN}${INDENT}==> Ceph Codename: ${CEPH_CODENAME}${RESET}"
|
||||
|
||||
# -----------------------------------------------------
|
||||
# PVE No-Subscription Repo
|
||||
# -----------------------------------------------------
|
||||
echo -e "${CYAN}${INDENT}==> Erstelle PVE No-Subscription Repo...${RESET}"
|
||||
|
||||
cat <<EOF > /etc/apt/sources.list.d/pve-no-subscription.sources
|
||||
# pve-no-subscription.enabled
|
||||
cat <<EOF > /etc/apt/sources.list.d/proxmox.sources
|
||||
Types: deb
|
||||
URIs: http://download.proxmox.com/debian/pve
|
||||
Suites: trixie
|
||||
Components: pve-no-subscription
|
||||
Signed-By: ${KEYRING}
|
||||
Enabled: true
|
||||
EOF
|
||||
|
||||
# -----------------------------------------------------
|
||||
# Ceph No-Subscription Repo
|
||||
# -----------------------------------------------------
|
||||
echo -e "${CYAN}${INDENT}==> Erstelle Ceph No-Subscription Repo...${RESET}"
|
||||
|
||||
cat <<EOF > /etc/apt/sources.list.d/ceph-no-subscription.sources
|
||||
# ceph.sources (Enterprise Disabled + No-Subscription Enabled)
|
||||
cat <<EOF > /etc/apt/sources.list.d/ceph.sources
|
||||
Types: deb
|
||||
URIs: http://download.proxmox.com/debian/ceph-${CEPH_CODENAME}
|
||||
URIs: https://enterprise.proxmox.com/debian/ceph-squid
|
||||
Suites: trixie
|
||||
Components: main
|
||||
Components: enterprise
|
||||
Signed-By: ${KEYRING}
|
||||
Enabled: false
|
||||
|
||||
Types: deb
|
||||
URIs: http://download.proxmox.com/debian/ceph-squid
|
||||
Suites: trixie
|
||||
Components: no-subscription
|
||||
Signed-By: ${KEYRING}
|
||||
Enabled: true
|
||||
EOF
|
||||
|
||||
# -----------------------------------------------------
|
||||
# APT Update
|
||||
# -----------------------------------------------------
|
||||
echo -e "${CYAN}${INDENT}==> APT Update...${RESET}"
|
||||
echo -e "${INDENT}==> APT Update..."
|
||||
apt update
|
||||
|
||||
echo
|
||||
echo -e "${GREEN}${INDENT}✔ Repositories erfolgreich eingerichtet!${RESET}"
|
||||
echo -e "${CYAN}${INDENT}PVE 9 nutzt jetzt No-Subscription Repos.${RESET}"
|
||||
echo -e "${CYAN}${INDENT}Ceph Repo: ceph-${CEPH_CODENAME}${RESET}"
|
||||
echo -e "${INDENT}PVE 9 + Ceph (squid) nutzen jetzt No-Subscription."
|
||||
|
||||
Reference in New Issue
Block a user