Skip to content
Snippets Groups Projects
Commit 9927df0c authored by Bob Mottram's avatar Bob Mottram
Browse files

Singular attempt to add matrix user per call

parent 7e703175
No related branches found
No related tags found
No related merge requests found
...@@ -446,15 +446,10 @@ function add_user_matrix { ...@@ -446,15 +446,10 @@ function add_user_matrix {
"${PROJECT_NAME}-pass" -u "$new_username" -a matrix -p "$new_user_password" "${PROJECT_NAME}-pass" -u "$new_username" -a matrix -p "$new_user_password"
# shellcheck disable=SC2034 if register_new_matrix_user -c "${MATRIX_DATA_DIR}/homeserver.yaml" -u "${new_username}" -p "${new_user_password}" $add_user_matrix_admin http://localhost:${MATRIX_PORT}; then
for i in {1..10} echo "0"
do return
if register_new_matrix_user -c "${MATRIX_DATA_DIR}/homeserver.yaml" -u "${new_username}" -p "${new_user_password}" $add_user_matrix_admin http://localhost:${MATRIX_PORT}; then fi
echo "0"
return
fi
sleep 2
done
echo "1" echo "1"
} }
...@@ -1070,7 +1065,18 @@ function install_matrix { ...@@ -1070,7 +1065,18 @@ function install_matrix {
increment_app_install_progress increment_app_install_progress
if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}" | tail -n 1) != "0" ]]; then matrix_user_added=
# shellcheck disable=SC2034
for i in {1..10}
do
if [[ $(add_user_matrix "${MY_USERNAME}" "${MATRIX_PASSWORD}" | tail -n 1) == "0" ]]; then
matrix_user_added=1
break
fi
sleep 2
done
if [ ! $matrix_user_added ]; then
echo $'Failed to add matrix admin user'; echo $'Failed to add matrix admin user';
exit 87 exit 87
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment