1
0
mirror of https://github.com/owncloud/ocis.git synced 2025-04-18 23:44:07 +03:00
ocis/scripts/create-files.sh
Jörn Friedrich Dreyer c768791b2d add create scripts
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2021-06-22 10:00:34 +00:00

20 lines
606 B
Bash

#!/bin/bash
CLIENTS=${CLIENTS:-2}
COUNT=${COUNT:-100}
OCIS_URL=${OCIS_URL:-https://localhost:9200}
ENDPOINT=${ENDPOINT:-/webdav}
FOLDER=${FOLDER:-c$CLIENTS x i$COUNT files}
USER=${USER:-einstein}
PASSWORD=${PASSWORD:-relativity}
CURL_OPTS=${CURL_OPTS:--k}
curl -X MKCOL "$OCIS_URL$ENDPOINT/$FOLDER/" -u $USER:$PASSWORD $CURL_OPTS || { echo "could not create collection '$OCIS_URL$ENDPOINT/$FOLDER/'" >&2; exit 1; }
for c in $(seq 1 $CLIENTS);
do
{
for i in $(seq 1 $COUNT);
do
curl -X PUT -d "$c,$i" "$OCIS_URL$ENDPOINT/$FOLDER/file c$c i$i.txt" -u $USER:$PASSWORD $CURL_OPTS
done
} &
done