Modification du traitement des répertoires, placés avant les fichiers

This commit is contained in:
Breizh 2022-09-25 18:50:05 +02:00
parent a99abeb440
commit 3ab84d1612
1 changed files with 31 additions and 1 deletions

View File

@ -90,9 +90,39 @@ header "$webpath" "$navpath" > index.html
preload=metadata # type de préchargement des fichiers audio
mkdir -p "$cache" # création du dossier de cache
# Pour chaque fichier ou dossier
# Pour chaque dossier
for i in */
do
if [[ ! -d "$i" ]]
then continue
fi
# Initialisation
unset lastmodif kbytes size thumbname mimetype
# Exclusion(s), relative(s) ou absolue(s)
if [[ "$i" == "index.html" ]] \
|| [[ "$(realpath "$i")" =~ ^$root/p ]] \
|| [[ "$(realpath "$i")" =~ ^$root/robots.txt ]]
then
continue
fi
# Date de dernière modif
lastmodif="$(stat -c "%y" "$i" | cut -d':' -f-2)"
# Insertion de la ligne du tableau correspondant au fichier en cours de traitement
row "$i" "0" "-" "$lastmodif" "inode/directory" >> index.html
done
# Pour chaque fichier
for i in *
do
if [[ -d "$i" ]]
then continue
fi
# Initialisation
unset lastmodif kbytes size thumbname mimetype