Update samba_backup_restore.sh

This commit is contained in:
jfontaine35 2025-02-05 17:54:37 +01:00 committed by GitHub
parent ffeb6a41f0
commit 77c7f5ef2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -113,8 +113,13 @@ restore_gpo() {
echo -e "${GREEN}Restauration des GPO depuis $GPO_BACKUP_DIR${NC}"
# Lister les GPO disponibles dans le répertoire de sauvegarde
local GPO_LIST=$(ls "$GPO_BACKUP_DIR")
# Utiliser samba-tool pour restaurer les GPO
samba-tool gpo restore "$GPO_BACKUP_DIR" -U "$ADMIN_USER" --password="$ADMIN_PASS"
for gpo in $GPO_LIST; do
samba-tool gpo restore "$gpo" "$GPO_BACKUP_DIR" -U "$ADMIN_USER" --password="$ADMIN_PASS"
done
if [ $? -eq 0 ]; then
echo -e "${GREEN}Restauration des GPO terminée.${NC}"