modif du post mattermost qui ne marchait plus

This commit is contained in:
Didier committed 2026-11-22 16:40:24 +01:00
1 parent de5231e03d
commit 23dbea6b90
1 file changed
+6 -5
+6 -5
View File
@@ -53,11 +53,12 @@ TEXTE="
# dupont ; jean-louis; jean-louis.dupont@kaz.bzh ; gregomondo@kaz.bzh; gogol ; O; O; N; N; N; N;N;;gogol_team; 10
"
PostMattermost() {
PostM=$1
CHANNEL="kaz:Creation-Comptes"
. $KAZ_KEY_DIR/env-mattermostAdmin
docker exec -t ${mattermostServName} bin/mmctl --suppress-warnings auth login $httpProto://$URL_AGORA --name local-server --username $mattermost_user --password $mattermost_pass >/dev/null 2>&1
docker exec -t mattermostServ bin/mmctl post create ${CHANNEL} --message ${PostM} >/dev/null 2>&1
PostM=$1
CHANNEL=$2
TEAMID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "${URL_AGORA_API}/teams/name/${EQUIPE}" | jq -r .id )
CHANNELID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" ${URL_AGORA_API}/teams/${TEAMID}/channels/name/${CHANNEL} | jq -r .id )
curl -s i-X POST -i -H "Authorization: Bearer ${mattermost_token}" -d "{\"channel_id\":\"${CHANNELID}\",\"message\":\"${PostM}\"}" "${URL_AGORA_API}/posts" >/dev/null 2>&1
}
ExpMail() {
@@ -171,7 +172,7 @@ Int_paheko_Action() {
if [[ "${IP_MAIL}" = "true" && "$(cat ${FILE_NOTIFICATION})" -ne "1" ]]
then
ExpMail ${IP_MAILDEST} "Erreur dans la fiche paheko" "${ERRMSG}"
PostMattermost "Erreur dans la fiche paheko ${email}"
PostMattermost "Erreur dans la fiche paheko ${email}" "Creation-Comptes"
# on ecrit 1 dans le fichier pour ne pas envoyer pleins de mails et notif agora
echo 1 >${FILE_NOTIFICATION}
fi