upgrade filterTest (exit code)

This commit is contained in:
François 2023-01-23 14:09:08 +01:00
parent 2980767d53
commit f51dc3f7a3
4 changed files with 12 additions and 9 deletions

View File

@ -122,7 +122,7 @@ curlJirafeauSend () {
type=$3 type=$3
[ -z "${type}" ] && type="text/plain" [ -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\"" 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" curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=\"$4\"" "${JIRAFEAU_LOCAL}/a.php"
} }

View File

@ -113,7 +113,7 @@ curlJirafeauSend () {
type=$3 type=$3
[ -z "${type}" ] && type="text/plain" [ -z "${type}" ] && type="text/plain"
LOG "curl -X POST -F \"time=$1\" -F \"key=$5\" -F \"file=@$2;type=${type};filename=\\\"$4\\\"\" \"${JIRAFEAU_LOCAL}/a.php\"" LOG "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" curl -X POST -F "time=$1" -F "key=$5" -F "file=@$2;type=${type};filename=\"$4\"" "${JIRAFEAU_LOCAL}/a.php" || exit 1
#"${jirafeauAPI}" -f "${JIRAFEAU_LOCAL}" -t "$1" -s "1Gi" -c "${type}" -n "$4" send "$2" "$5" #"${jirafeauAPI}" -f "${JIRAFEAU_LOCAL}" -t "$1" -s "1Gi" -c "${type}" -n "$4" send "$2" "$5"
} }
@ -144,7 +144,7 @@ done
######################################## ########################################
# extraction des pièces jointes # extraction des pièces jointes
"${eMailShrinker}" ${DEBUG} -s "5ki" -d "${TMP_DIR}/PJ" "${mbox}" > "${TMP_DIR}/PJ-name.txt" "${eMailShrinker}" ${DEBUG} -s "5ki" -d "${TMP_DIR}/PJ" "${mbox}" > "${TMP_DIR}/PJ-name.txt" || exit 1
LOG " - ${BLUE}PJ-name: ${NC}" LOG " - ${BLUE}PJ-name: ${NC}"
cat "${TMP_DIR}/PJ-name.txt" cat "${TMP_DIR}/PJ-name.txt"
@ -177,6 +177,7 @@ cat "${TMP_DIR}/PJ-name.txt" | {
LOG " - ${RED}can't upload ${ATTACH_MEDIA} <${JIR_TOKEN}> <${JIR_CODE}>${NC}" LOG " - ${RED}can't upload ${ATTACH_MEDIA} <${JIR_TOKEN}> <${JIR_CODE}>${NC}"
cat "${TMP_DIR}/one.txt" >> "${TTY}" cat "${TMP_DIR}/one.txt" >> "${TTY}"
echo "url:" echo "url:"
exit 1
;; ;;
* ) * )
LOG " - ${GREEN} upload ${ATTACH_MEDIA}${NC}" LOG " - ${GREEN} upload ${ATTACH_MEDIA}${NC}"
@ -190,7 +191,7 @@ cat "${TMP_DIR}/PJ-name.txt" | {
if [ "${NB_ATTACH}" -gt 1 ]; then if [ "${NB_ATTACH}" -gt 1 ]; then
PASSWORD=$(apg -n 1 -m 12 -M cln) PASSWORD=$(apg -n 1 -m 12 -M cln)
PASSWORD_MD5=$(echo -n ${PASSWORD} | ${MD5_CMD} | cut -d \ -f 1) PASSWORD_MD5=$(echo -n ${PASSWORD} | ${MD5_CMD} | cut -d \ -f 1)
curlJirafeauSend "month" "${TMP_DIR}/archive-content.txt" "text/kaz_email_archive" "archive_content" "${PASSWORD}" 2>> "${TTY}" > "${TMP_DIR}/one.txt" curlJirafeauSend "month" "${TMP_DIR}/archive-content.txt" "text/kaz_email_archive" "archive_content" "${PASSWORD}" 2>> "${TTY}" > "${TMP_DIR}/one.txt" || exit 1
cat "${TMP_DIR}/one.txt" | { cat "${TMP_DIR}/one.txt" | {
read JIR_TOKEN read JIR_TOKEN
read JIR_CODE read JIR_CODE
@ -198,6 +199,7 @@ cat "${TMP_DIR}/PJ-name.txt" | {
"" | no | *Error* | \<* ) "" | no | *Error* | \<* )
LOG " - ${RED}can't upload ${TMP_DIR}/archive-content.txt${NC}" LOG " - ${RED}can't upload ${TMP_DIR}/archive-content.txt${NC}"
echo "arch: bad" echo "arch: bad"
exit 1
;; ;;
* ) * )
LOG " - ${GREEN} upload archive-content.txt${NC}" LOG " - ${GREEN} upload archive-content.txt${NC}"
@ -219,11 +221,12 @@ LOG " - ${GREEN}ATTACH_MODE: ${ATTACH_MODE}${NC}"
######################################## ########################################
# substitution des pièces jointes par les codes fournis par jirafeau # substitution des pièces jointes par les codes fournis par jirafeau
cat "${TMP_DIR}/PJ-Keys.txt" | "${eMailShrinker}" ${DEBUG} ${ATTACH_MODE} -s "5ki" "${mbox}" "${TMP_DIR}/new-mbox" 2>> "${TTY}" cat "${TMP_DIR}/PJ-Keys.txt" | "${eMailShrinker}" ${DEBUG} ${ATTACH_MODE} -s "5ki" "${mbox}" "${TMP_DIR}/new-mbox" 2>> "${TTY}" || exit 1
######################################## ########################################
# affichage de la structure à la fin # affichage de la structure à la fin
LOG " - ${BLUE}new-mbox:${NC}" LOG " - ${BLUE}new-mbox:${NC}"
"${eMailShrinker}" -l "${TMP_DIR}/new-mbox" 2>> "${TTY}" "${eMailShrinker}" -l "${TMP_DIR}/new-mbox" 2>> "${TTY}" || exit 1
echo -e "\nresul in ${TMP_DIR}/new-mbox" echo -e "\nresul in ${TMP_DIR}/new-mbox"
exit 0

View File

@ -800,7 +800,7 @@ MainAttachment::substitute (ifstream &mbox, ofstream &outbox, const SizeArg &min
} }
attachP->println (outbox, content); attachP->println (outbox, content);
} else { } else {
LOG_BUG (true, continue, "eMailShrinker: bug M8: can't change" << *attachP); LOG_BUG (true, continue, "eMailShrinker: upload has failed, so can't change" << *attachP);
} }
outbox.flush (); outbox.flush ();
curPos = attachP->endPos; curPos = attachP->endPos;

View File

@ -33,8 +33,8 @@
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
#include "version.hpp" #include "version.hpp"
const std::string kaz::LAST_VERSION_NUM ("2.15"); const std::string kaz::LAST_VERSION_NUM ("2.16");
const std::string kaz::LAST_VERSION_DATE ("2023-01-22"); const std::string kaz::LAST_VERSION_DATE ("2023-01-23");
const std::string kaz::LAST_VERSION (LAST_VERSION_NUM+" "+LAST_VERSION_DATE+" eMailShrinker"); const std::string kaz::LAST_VERSION (LAST_VERSION_NUM+" "+LAST_VERSION_DATE+" eMailShrinker");
#include <iostream> #include <iostream>