modif du post mattermost qui ne marchait plus
This commit is contained in:
1 parent
de5231e03d
commit
23dbea6b90
1 file changed
+7
-6
+7
-6
@@ -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
|
# dupont ; jean-louis; jean-louis.dupont@kaz.bzh ; gregomondo@kaz.bzh; gogol ; O; O; N; N; N; N;N;;gogol_team; 10
|
||||||
"
|
"
|
||||||
PostMattermost() {
|
PostMattermost() {
|
||||||
PostM=$1
|
. $KAZ_KEY_DIR/env-mattermostAdmin
|
||||||
CHANNEL="kaz:Creation-Comptes"
|
PostM=$1
|
||||||
. $KAZ_KEY_DIR/env-mattermostAdmin
|
CHANNEL=$2
|
||||||
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
|
TEAMID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "${URL_AGORA_API}/teams/name/${EQUIPE}" | jq -r .id )
|
||||||
docker exec -t mattermostServ bin/mmctl post create ${CHANNEL} --message ${PostM} >/dev/null 2>&1
|
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() {
|
ExpMail() {
|
||||||
@@ -171,7 +172,7 @@ Int_paheko_Action() {
|
|||||||
if [[ "${IP_MAIL}" = "true" && "$(cat ${FILE_NOTIFICATION})" -ne "1" ]]
|
if [[ "${IP_MAIL}" = "true" && "$(cat ${FILE_NOTIFICATION})" -ne "1" ]]
|
||||||
then
|
then
|
||||||
ExpMail ${IP_MAILDEST} "Erreur dans la fiche paheko" "${ERRMSG}"
|
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
|
# on ecrit 1 dans le fichier pour ne pas envoyer pleins de mails et notif agora
|
||||||
echo 1 >${FILE_NOTIFICATION}
|
echo 1 >${FILE_NOTIFICATION}
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user