liste des fichiers MD dans le dépot

This commit is contained in:
Cédric Abonnel 2024-07-24 02:55:09 +02:00
parent 6d45a52983
commit 6f7dfecef4
2 changed files with 39 additions and 0 deletions

10
FILES.md Normal file
View File

@ -0,0 +1,10 @@
- [./code_of_conduct.md](./code_of_conduct.md)
- [./contribute.md](./contribute.md)
- [./notes/certificats/creer_une_autorite_de_certification_CA_privee.md](./notes/certificats/creer_une_autorite_de_certification_CA_privee.md)
- [./notes/serveur/fail2ban.md](./notes/serveur/fail2ban.md)
- [./notes/serveur/fail2ban-postfix-sasl.md](./notes/serveur/fail2ban-postfix-sasl.md)
- [./notes/serveur/fail2ban-sshd.md](./notes/serveur/fail2ban-sshd.md)
- [./notes/serveur/postfix-delete-messages-deferred.md](./notes/serveur/postfix-delete-messages-deferred.md)
- [./notes/webapps/clamav-avec-nextcloud.md](./notes/webapps/clamav-avec-nextcloud.md)
- [./update_files.md](./update_files.md)
- [./FILES.md](./FILES.md)

29
update_files.md Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# Fichier README.md
README="FILES.md"
# Temporary file for new list
TEMP_FILE=$(mktemp)
# Get all .md files in the repository except the README.md
find . -type f -name "*.md" ! -name "README.md" | sort > "$TEMP_FILE"
# Extract the list of .md files from README.md
grep -o '\[.*\](.*\.md)' "$README" | sed 's/^.*(\(.*\))$/\1/' | sort > "${README}.old"
# Compare and update README.md
comm -23 "${README}.old" "$TEMP_FILE" | while read -r file; do
echo "Removing $file from $README"
sed -i "\|$file|d" "$README"
done
comm -13 "${README}.old" "$TEMP_FILE" | while read -r file; do
echo "Adding $file to $README"
echo "- [$file]($file)" >> "$README"
done
# Clean up
rm "$TEMP_FILE" "${README}.old"
echo "$README has been updated."