fix sh
This commit is contained in:
parent
0088efd369
commit
a451fa8306
1 changed files with 6 additions and 3 deletions
|
@ -15,15 +15,18 @@ inotifywait -m "$WATCH_PATH" -e close_write |
|
|||
file_size=$(stat -c%s "$file_path")
|
||||
num_chunks=$(( (file_size + chunk_size - 1) / chunk_size ))
|
||||
|
||||
for (( i=0; i<num_chunks; i++ )); do
|
||||
i=0
|
||||
while [ $i -lt $num_chunks ]; do
|
||||
offset=$(( i * chunk_size ))
|
||||
dd if="$file_path" bs=$chunk_size skip=$i count=1 2>/dev/null | curl \
|
||||
--location "$UPLOAD_URL" \
|
||||
dd if="$file_path" bs=$chunk_size skip=$i count=1 2>/dev/null | \
|
||||
curl --location "$UPLOAD_URL" \
|
||||
--header "Authorization: Bearer $AUTH_TOKEN" \
|
||||
--form "recording_id=${id}" \
|
||||
--form "chunk_index=${i}" \
|
||||
--form "total_chunks=${num_chunks}" \
|
||||
--form "FILE=@-"
|
||||
|
||||
i=$(( i + 1 ))
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue