vire les heredoc
This commit is contained in:
+8
-8
@@ -621,12 +621,12 @@ userPassword: {CRYPT}${pass}\n\n' | ldapmodify -c -H ldap://${LDAP_IP} -D \"cn=$
|
||||
# on créé le compte mattermost
|
||||
#echo "docker exec -i mattermostServ bin/mmctl user create --email ${EMAIL_SOUHAITE} --username ${IDENT_KAZ} --password ${PASSWORD}" | tee -a "${CMD_LOGIN}"
|
||||
#on remplace par l'api rest
|
||||
cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
# cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
curl -s -X POST "https://${URL_AGORA}/api/v4/users" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"email":"${EMAIL_SOUHAITE}","username":"${IDENT_KAZ}","password":"${PASSWORD}"}'
|
||||
EOF
|
||||
# EOF
|
||||
|
||||
#quel user_id ?
|
||||
USER_ID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/users/email/${EMAIL_SOUHAITE}" | jq -r '.id')
|
||||
@@ -635,12 +635,12 @@ EOF
|
||||
|
||||
# et enfin on ajoute toujours le user à l'équipe KAZ et aux 2 channels publiques
|
||||
#echo "docker exec -i mattermostServ bin/mmctl team users add kaz ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
# cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
curl -s -X POST "https://${URL_AGORA}/api/v4/teams/${KAZ_ID}/members" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"team_id":"${KAZ_ID}","user_id":"${USER_ID}"}'
|
||||
EOF
|
||||
# EOF
|
||||
|
||||
CHAN1_ID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/kaz/channels/name/une-question--un-soucis" | jq -r '.id')
|
||||
CHAN2_ID=$(curl -s -H "Authorization: Bearer ${mattermost_token}" "https://${URL_AGORA}/api/v4/teams/name/kaz/channels/name/cafe-du-commerce--ouvert-2424h" | jq -r '.id')
|
||||
@@ -648,17 +648,17 @@ EOF
|
||||
# echo "docker exec -i mattermostServ bin/mmctl channel users add kaz:une-question--un-soucis ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
# echo "docker exec -i mattermostServ bin/mmctl channel users add kaz:cafe-du-commerce--ouvert-2424h ${EMAIL_SOUHAITE}" | tee -a "${CMD_LOGIN}"
|
||||
|
||||
cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
# cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
curl -s -X PUT "https://${URL_AGORA}/api/v4/channels/${CHAN1_ID}/members/${USER_ID}" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json"
|
||||
EOF
|
||||
# EOF
|
||||
|
||||
cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
# cat <<EOF | tee -a "${CMD_LOGIN}"
|
||||
curl -s -X PUT "https://${URL_AGORA}/api/v4/channels/${CHAN2_ID}/members/${USER_ID}" \
|
||||
-H "Authorization: Bearer ${mattermost_token}" \
|
||||
-H "Content-Type: application/json"
|
||||
EOF
|
||||
# EOF
|
||||
|
||||
NB_SERVICES_BASE=$((NB_SERVICES_BASE+1))
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user