#!/usr/bin/env bash set -euo pipefail REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)" echo "[!] Script de restauration Arch" echo "[!] À lancer uniquement sur une installation fraîche ou volontairement préparée." echo read -rp "Continuer ? [y/N] " confirm if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then echo "Annulé." exit 0 fi echo "[*] Restauration des fichiers système" sudo rsync -aAXH \ "$REPO_DIR/rootfs/" / echo "[*] Installation des paquets officiels" sudo pacman -Syu --needed - < "$REPO_DIR/pkglist/pacman.txt" echo "[*] Paquets AUR" if command -v paru >/dev/null 2>&1; then paru -S --needed - < "$REPO_DIR/pkglist/aur.txt" else echo "[!] paru absent, paquets AUR non installés." echo "[!] Installe paru puis lance :" echo " paru -S --needed - < pkglist/aur.txt" fi echo "[*] Rechargement systemd" sudo systemctl daemon-reload echo "[*] Services à réactiver manuellement selon systemd/enabled-system.txt" echo "[*] Exemple :" echo " sudo systemctl enable --now NetworkManager.service" echo " sudo systemctl enable --now nftables.service" echo " sudo systemctl enable --now sshd.service" echo " sudo systemctl enable --now snapper-timeline.timer" echo " sudo systemctl enable --now snapper-cleanup.timer" echo echo "[+] Restauration terminée." echo "[!] Vérifie /etc/fstab, Limine, Snapper et Secure Boot avant reboot."