From 97707f1ffd02042b17ae81f1d607a244a1ae6498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drix?= Date: Sat, 8 Mar 2025 02:40:12 +0100 Subject: [PATCH] =?UTF-8?q?facilitateur=20de=20t=C3=A9l=C3=A9chargement=20?= =?UTF-8?q?des=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/server-mail/README.md | 11 ++++------- .../server-mail/scripts/.prep_scripts_list.sh | 18 ++++++++++++++++++ notes/server-mail/scripts/scripts.txt | 13 +++++++++++++ 3 files changed, 35 insertions(+), 7 deletions(-) create mode 100755 notes/server-mail/scripts/.prep_scripts_list.sh create mode 100644 notes/server-mail/scripts/scripts.txt diff --git a/notes/server-mail/README.md b/notes/server-mail/README.md index edf4451..9f51130 100644 --- a/notes/server-mail/README.md +++ b/notes/server-mail/README.md @@ -25,15 +25,12 @@ Pour télécharger uniquement les scripts `.sh` et `.py` du dossier `server-mail/scripts`, utilisez la commande suivante : ```bash -wget -r -np -nd --cut-dirs=5 -A "*.sh,*.py" https://git.abonnel.fr/cedricAbonnel/notes-techniques/src/branch/main/notes/server-mail/scripts +wget -O scripts.txt "https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/scripts.txt" +wget -P . -i scripts.txt + ``` -### 📝 Explication des options : -- `-r` : Téléchargement récursif -- `-np` : Empêche de remonter dans les répertoires parents -- `-nd` : Évite la création d'une arborescence locale (télécharge tout dans le dossier courant) -- `--cut-dirs=5` : Ignore les 5 premiers niveaux de répertoires dans le chemin -- `-A "*.sh,*.py"` : Télécharge uniquement les fichiers avec l’extension `.sh` et `.py` +✅ Tous les fichiers listés dans scripts.txt seront téléchargés automatiquement dans le dossier courant. 📌 **Astuce** : Assurez-vous d’exécuter cette commande dans le dossier où vous souhaitez stocker les fichiers. diff --git a/notes/server-mail/scripts/.prep_scripts_list.sh b/notes/server-mail/scripts/.prep_scripts_list.sh new file mode 100755 index 0000000..29af46f --- /dev/null +++ b/notes/server-mail/scripts/.prep_scripts_list.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Nom du fichier de sortie +OUTPUT_FILE="scripts.txt" + +# Nettoyage du fichier s'il existe déjà +> "$OUTPUT_FILE" + +# Récupérer le chemin absolu du dossier courant côté Git +BASE_URL="https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts" + +# Lister tous les fichiers .sh et .py et générer l'URL complète +for file in *.sh *.py; do + [ -e "$file" ] || continue # Vérifie si des fichiers existent pour éviter une erreur + echo "$BASE_URL/$file" >> "$OUTPUT_FILE" +done + +echo "✅ Liste des scripts générée dans $OUTPUT_FILE" diff --git a/notes/server-mail/scripts/scripts.txt b/notes/server-mail/scripts/scripts.txt new file mode 100644 index 0000000..b417d91 --- /dev/null +++ b/notes/server-mail/scripts/scripts.txt @@ -0,0 +1,13 @@ +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/add_alias.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/add_domain.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/add_forward.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/add_user.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/del_alias.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/del_domain.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/del_user.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/generate_password.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/generate_script_list.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/list_aliases.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/list_domains_.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/list_users.sh +https://git.abonnel.fr/cedricAbonnel/notes-techniques/raw/branch/main/notes/server-mail/scripts/setup_mail.sh