This commit is contained in:
holzi1005 2025-01-07 18:14:43 +01:00
parent 216198ea8a
commit 9b34046aca

View file

@ -26,7 +26,8 @@ inotifywait -m /out -e close_write |
# Datei in Chunks hochladen
i=0
while [ $i -lt $num_chunks ]; do
while [ $i -lt $num_chunks ]
do
# Temporäre Datei für den Chunk
temp_chunk_file="/tmp/chunk_$i"
@ -34,7 +35,8 @@ inotifywait -m /out -e close_write |
dd if="$file_path" bs=$chunk_size skip=$i count=1 of="$temp_chunk_file" 2>/dev/null
# Überprüfen, ob der Chunk erfolgreich erstellt wurde
if [ -f "$temp_chunk_file" ]; then
if [ -f "$temp_chunk_file" ]
then
# Chunk hochladen
curl --location "$UPLOAD_URL" \
--header "Authorization: Bearer $AUTH_TOKEN" \
@ -52,7 +54,4 @@ inotifywait -m /out -e close_write |
# Inkrementieren des Chunk-Zählers
i=$(( i + 1 ))
done
done