diff --git a/src/bash/filter.sh b/src/bash/filter.sh index 0ac6979..e5aabed 100755 --- a/src/bash/filter.sh +++ b/src/bash/filter.sh @@ -243,7 +243,7 @@ fi ######################################## # Préparation pour le cloud -rm -f "${TMP_DIR}/last.txt" +rm -f "${REP_PIECE_JOINTE}/last.txt" # Etape de rafraichissement des anciens fichiers inclus echo "time: ${DATE_TEMPS}${NL}id: $(date +%s)" > "${ARCHIVE_CONTENT}" @@ -259,7 +259,7 @@ cat "${OLD_LINKS}" | grep "${JIRAFEAU_URL}" | while read REMOTE_LINK; do # update periode for download curlJirafeauUpdate "${PERIOD}" "${REMOTE_REF}" 2>&1 >> "${TMP_LOG}" echo "old: ${REMOTE_REF} ${REMOTE_KEY}" >> "${ARCHIVE_CONTENT}" - echo "f=${REMOTE_REF}~${REMOTE_KEY}" > "${TMP_DIR}/last.txt" + echo "f=${REMOTE_REF}~${REMOTE_KEY}" > "${REP_PIECE_JOINTE}/last.txt" done LOG_FIC " - archive starts with: ${NL}${YELLOW}$(cat ${ARCHIVE_CONTENT})${NC}" @@ -296,7 +296,7 @@ LOG_FIC "${CYAN}${SHRINK_CMD} -s \"${MAX_KEEP_IN_MAIL}\" -d \"${REP_PIECE_JOINTE LOG_FIC " - change by link ${YELLOW}${JIRAFEAU_URL}/f.php?d=0&h=${JIR_TOKEN}&k=${PASSWORD_MD5}${NC}" echo "url: ${JIRAFEAU_URL}/f.php?d=0&h=${JIR_TOKEN}&k=${PASSWORD_MD5}" echo "new: ${JIR_TOKEN} ${PASSWORD_MD5}" >> "${ARCHIVE_CONTENT}" - echo "f=${JIR_TOKEN}~${PASSWORD_MD5}" > "${TMP_DIR}/last.txt" + echo "f=${JIR_TOKEN}~${PASSWORD_MD5}" > "${REP_PIECE_JOINTE}/last.txt" ;; esac } @@ -327,7 +327,7 @@ LOG_FIC "${CYAN}${SHRINK_CMD} -s \"${MAX_KEEP_IN_MAIL}\" -d \"${REP_PIECE_JOINTE * ) LOG_FIC " - add archive ${YELLOW}${JIRAFEAU_URL}/a.php?g=${JIR_TOKEN}~${PASSWORD_MD5}${NC}" echo "arch: ${JIRAFEAU_URL}/a.php?g=${JIR_TOKEN}~${PASSWORD_MD5}" - echo "a=${JIR_TOKEN}~${PASSWORD_MD5}" > "${TMP_DIR}/last.txt" + echo "a=${JIR_TOKEN}~${PASSWORD_MD5}" > "${REP_PIECE_JOINTE}/last.txt" ;; esac } @@ -335,8 +335,8 @@ LOG_FIC "${CYAN}${SHRINK_CMD} -s \"${MAX_KEEP_IN_MAIL}\" -d \"${REP_PIECE_JOINTE LOG_FIC " - no archive (less than 2 attach file)" echo "arch: none" fi - if [ -s "${TMP_DIR}/last.txt" ]; then - echo "cloud: ${JIRAFEAU_URL}/c.php?$(cat "${TMP_DIR}/last.txt")" + if [ -s "${REP_PIECE_JOINTE}/last.txt" ]; then + echo "cloud: ${JIRAFEAU_URL}/c.php?$(cat "${REP_PIECE_JOINTE}/last.txt")" else echo "cloud: none" fi diff --git a/src/bash/filterTest.sh b/src/bash/filterTest.sh index 1ec7470..dfa9a64 100755 --- a/src/bash/filterTest.sh +++ b/src/bash/filterTest.sh @@ -52,6 +52,7 @@ NL=' ' PERIODE="month" +MD5_CMD=/usr/bin/md5sum ######################################## LOG () { echo -e "$1" 1>&2 diff --git a/src/cpp/MainAttachment.cpp b/src/cpp/MainAttachment.cpp index 9e778a7..3b83c2e 100644 --- a/src/cpp/MainAttachment.cpp +++ b/src/cpp/MainAttachment.cpp @@ -223,6 +223,7 @@ MainAttachment::readArchiveUrl () { archiveDownloadURL.clear (); string line; getline (cin, line); + LOG ("get arch: " << line); LOG_BUG (line.rfind ("arch: ", 0) != 0, return, "eMailShrinker: bug M9: no archive link. (line: " << line << ")"); LOG_BUG (line.rfind ("arch: bad", 0) == 0, return, "eMailShrinker: bug M10: bad archive link. (line: " << line << ")"); if (line.rfind ("arch: none", 0) == 0) @@ -237,6 +238,7 @@ MainAttachment::readCloudUrl () { DEF_LOG ("MainAttachment::readCloudUrl", ""); string line; getline (cin, line); + LOG ("get cloud: " << line); LOG_BUG (line.rfind ("cloud: ", 0) != 0, return, "eMailShrinker: bug M13: no cloud link. (line: " << line << ")"); LOG_BUG (line.rfind ("cloud: bad", 0) == 0, return, "eMailShrinker: bug M14: bad cloud link. (line: " << line << ")"); if (line.rfind ("cloud: none", 0) == 0)