Format shell scripts

Fix flags order
This commit is contained in:
jo 2021-08-16 13:45:32 +02:00
parent 6c2e547808
commit 8b3e09d41c
24 changed files with 1487 additions and 1499 deletions

View file

@ -1,21 +1,20 @@
#! /bin/bash
post_file() {
file_path=${1}
filename="${file_path##*/}"
file_path=${1}
filename="${file_path##*/}"
#kill process after 30 minutes (360*5=30 minutes)
max_retry=10
retry_count=0
#kill process after 30 minutes (360*5=30 minutes)
max_retry=10
retry_count=0
until curl --max-time 30 http://localhost/rest/media -u 3188BDIMPJROQP89Z0OX: -X POST -F "file=@${file_path}" -F "name=${filename}"
do
retry_count=$[$retry_count+1]
if [ $retry_count -ge $max_retry ]; then
break
fi
sleep 1
done
until curl --max-time 30 http://localhost/rest/media -u 3188BDIMPJROQP89Z0OX: -X POST -F "file=@${file_path}" -F "name=${filename}"; do
retry_count=$(($retry_count + 1))
if [ $retry_count -ge $max_retry ]; then
break
fi
sleep 1
done
}
post_file "${1}" &