From dce312c33e1739e869fdd50087eb6aa7f08c1aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Fri, 3 Mar 2023 15:22:13 +0100 Subject: [PATCH] retry upload --- src/bash/filter.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bash/filter.sh b/src/bash/filter.sh index a1260ae..6be24a4 100755 --- a/src/bash/filter.sh +++ b/src/bash/filter.sh @@ -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 #################################################