From 0b4069059f44e20c2e08d66198303ee20a30a283 Mon Sep 17 00:00:00 2001 From: admin-linexos Date: Mon, 10 Mar 2025 11:26:08 +0000 Subject: [PATCH] Actualiser recuperation_config.sh --- recuperation_config.sh | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/recuperation_config.sh b/recuperation_config.sh index fed4f73..dc2100c 100755 --- a/recuperation_config.sh +++ b/recuperation_config.sh @@ -66,15 +66,29 @@ fi echo "Copie des fichiers de configuration en maintenant l'arborescence dans la branche $BRANCH..." -while IFS= read -r file; do - if [ -f "$file" ]; then - DEST_DIR="$REPO_PATH/$HOSTNAME/$(dirname "$file")" - mkdir -p "$DEST_DIR" - cp "$file" "$DEST_DIR" - echo "Copié $file vers $DEST_DIR" - else - echo "Le fichier $file n'existe pas: $file" - fi +#while IFS= read -r file; do +# if [ -f "$file" ]; then +# DEST_DIR="$REPO_PATH/$HOSTNAME/$(dirname "$file")" +# mkdir -p "$DEST_DIR" +# cp "$file" "$DEST_DIR" +# echo "Copié $file vers $DEST_DIR" +# else +# echo "Le fichier $file n'existe pas: $file" +# fi +#done < "$CONFIG_FILE" + +while IFS= read -r pattern; do + # Trouver tous les fichiers correspondant au motif + for file in $pattern; do + if [ -f "$file" ]; then + DEST_DIR="$REPO_PATH/$HOSTNAME/$(dirname "$file")" + mkdir -p "$DEST_DIR" + cp "$file" "$DEST_DIR" + echo "Copié $file vers $DEST_DIR" + else + echo "Aucun fichier correspondant au motif : $pattern" + fi + done done < "$CONFIG_FILE" # Ajout et push des modifications