#!/bin/bash

#########################################################################
# pyeole.service - manage EOLE services
# Copyright © 2014 Pôle de Compétence EOLE <eole@ac-dijon.fr>
#
# License CeCILL:
#  * in french: http://www.cecill.info/licences/Licence_CeCILL_V2-fr.html
#  * in english http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
#########################################################################
. /usr/lib/eole/diagnose.sh


if [ $(CreoleGet activer_sympa non) == 'oui' ];then
    PID_NAMES="sympa_msg archived bulk bounced task_manager"

    EchoGras "*** Gestion de listes SYMPA"
    for pid_name in $PID_NAMES;do
        CreoleRun "pgrep ${pid_name}.pl" mail >/dev/null
        if [ $? == 0 ];then
             printf ".  %${len_pf}s => " "${pid_name}"
             EchoVert "Ok"
        else
             printf ".  %${len_pf}s => " "${pid_name}"
             EchoRouge "Erreur"
        fi
    done
    echo
fi
