Add tif-index2.json
erstellt eine index datei für alle tif dateien im Verzeichnis /scans/thinsection/cog_out
This commit is contained in:
parent
d6a2a57810
commit
e1538a1eda
1 changed files with 36 additions and 0 deletions
36
tif-index2.json
Normal file
36
tif-index2.json
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BASE="/scans/thinsect/cog_out"
|
||||||
|
OUT="/var/www/html/tif-index.json"
|
||||||
|
|
||||||
|
echo "{" > "$OUT"
|
||||||
|
|
||||||
|
FIRST=true
|
||||||
|
|
||||||
|
find "$BASE" -name "*.tif" | while read FILE
|
||||||
|
do
|
||||||
|
|
||||||
|
#
|
||||||
|
# Dateiname ohne .tif
|
||||||
|
#
|
||||||
|
NAME=$(basename "$FILE" .tif)
|
||||||
|
|
||||||
|
#
|
||||||
|
# relativer Pfad
|
||||||
|
#
|
||||||
|
REL="${FILE#$BASE/}"
|
||||||
|
|
||||||
|
if [ "$FIRST" = true ]; then
|
||||||
|
FIRST=false
|
||||||
|
else
|
||||||
|
echo "," >> "$OUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n " \"$NAME\": \"$REL\"" >> "$OUT"
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "" >> "$OUT"
|
||||||
|
echo "}" >> "$OUT"
|
||||||
|
|
||||||
|
echo "fertig: $OUT"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue