#!/usr/bin/env bash # Laedt die generierten Testdateien (/tmp/mcptest-files, via gen_testfiles.py) # in mcptests oCIS unter /testdata// hoch. set -euo pipefail OCIS_PW=$(sudo sed -n 's/OCIS_PW=//p' /root/.mcptest-creds) BASE="http://127.0.0.1:9200/remote.php/dav/files/mcptest"; AUTH="mcptest:$OCIS_PW" sub(){ case "$1" in *.jpg|*.png|*.webp|*.bmp|*.gif|*.tiff|*.svg) echo images;; *.mp3|*.ogg|*.m4a|*.flac|*.wav) echo audio;; *.mp4) echo video;; *.pdf|*.docx|*.xlsx|*.pptx) echo documents;; *.zip|*.gz) echo archives;; *) echo text;; esac; } curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/" || true for d in images audio video documents text archives; do curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/$d/" || true; done for f in /tmp/mcptest-files/*; do n=$(basename "$f"); curl -s -o /dev/null -u "$AUTH" -T "$f" "$BASE/testdata/$(sub "$n")/$n"; done echo "Upload fertig."