Adding matrix users
This commit is contained in:
parent
0e36a43ae0
commit
8c0afcc08e
|
@ -312,22 +312,16 @@ function remove_user_matrix {
|
|||
function add_user_matrix {
|
||||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
is_admin_user='-a'
|
||||
|
||||
read_config_param MY_USERNAME
|
||||
read_config_param ONION_ONLY
|
||||
read_config_param MATRIX_DOMAIN_NAME
|
||||
|
||||
if [[ "$new_username" != "$MY_USERNAME" ]]; then
|
||||
is_admin_user=''
|
||||
fi
|
||||
|
||||
${PROJECT_NAME}-pass -u $new_username -a matrix -p "$new_user_password"
|
||||
|
||||
if [[ $ONION_ONLY == 'no' ]]; then
|
||||
register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" $is_admin_user https://${MATRIX_DOMAIN_NAME}
|
||||
if [[ "$new_username" != "$MY_USERNAME" ]]; then
|
||||
echo 'no' | register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" http://localhost:${MATRIX_PORT}
|
||||
else
|
||||
register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" $is_admin_user http://${MATRIX_DOMAIN_NAME}
|
||||
echo 'yes' | register_new_matrix_user -c ${MATRIX_DATA_DIR}/homeserver.yaml -u "${new_username}" -p "${new_user_password}" -a http://localhost:${MATRIX_PORT}
|
||||
fi
|
||||
echo "0"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue