From f6f7381cc973165f65303f061741a01a1644bb69 Mon Sep 17 00:00:00 2001 From: unfr Date: Fri, 9 May 2025 13:50:58 +0200 Subject: [PATCH] Ajout protection segmentation fault --- autopost/posteur.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/autopost/posteur.sh b/autopost/posteur.sh index c84df06..f235bf7 100644 --- a/autopost/posteur.sh +++ b/autopost/posteur.sh @@ -41,8 +41,19 @@ do { echo -e ${VERT}"DEBUT DE TRAITEMENT DE" ${FILESANSEXT}${NORMAL} - echo -e ${CYAN}"CREATION DES PAR2"${NORMAL} - parpar -s10M -r20%+2 -m4096M -p1l -o ${FILESANSEXT}.par2 ${name} + echo -e ${CYAN}"CREATION DES PAR2"${NORMAL} + parpar -s10M -r20%+2 -m16384M -p1l -o ${FILESANSEXT}.par2 ${name} + ret=$? + if [ $ret -eq 139 ]; then + echo -e "${ROUGE}Segmentation fault détecté lors de parpar (${ret}).${NORMAL}" + sqlite3 "$DB_FILE" "BEGIN IMMEDIATE; UPDATE release SET status = 2 WHERE id = ${id}; COMMIT;" + # On supprime les éventuels fichiers générés avant de continuer + rm -f ${FILESANSEXT}.par2 ${FILESANSEXT}.vol* + continue # passe au prochain tour de la boucle while + elif [ $ret -ne 0 ]; then + echo -e "${ROUGE}Erreur parpar (code $ret).${NORMAL}" + # selon votre besoin, vous pouvez aussi traiter d'autres erreurs ici + fi echo -e ${VERT}"UPLOAD SUR USENET" ${NORMAL} checkusenet