retry upload

This commit is contained in:
François 2023-03-03 15:22:13 +01:00
parent f6db4af4fc
commit dce312c33e

View File

@ -123,7 +123,18 @@ curlJirafeauSend () {
type=$3
[ -z "${type}" ] && type="text/plain"
LOG_FIC " - curl -X POST -F \"time=$1\" -F \"key=$5\" -F \"file=@$2;type=${type};filename=\\\"$4\\\"\" \"${JIRAFEAU_LOCAL}/a.php\""
curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=\"$4\"" "${JIRAFEAU_LOCAL}/a.php"
for num in {1..2}; do
OUTPUT=$(curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=\"$4\"" "${JIRAFEAU_LOCAL}/a.php")
read JIR_TOKEN <<< "${OUTPUT}"
case "${JIR_TOKEN}" in
"" | no | *Error* | \<* )
sleep 30
continue
;;
esac
break
done
echo "${OUTPUT}"
}
#################### MAIN #################################################