Separate matrix user removal script generation

This commit is contained in:
Bob Mottram 2017-12-11 16:06:44 +00:00
parent ace9d9c5f9
commit 3fb870a6ff
1 changed files with 8 additions and 5 deletions

View File

@ -329,11 +329,7 @@ function matrix_generate {
matrix_configure_homeserver_yaml "${turnkey}" $homeserver_config
}
function remove_user_matrix {
remove_username="$1"
${PROJECT_NAME}-pass -u $remove_username --rmapp matrix
function create_matrix_user_removal_script {
read_config_param MY_USERNAME
read_config_param MATRIX_DOMAIN_NAME
@ -349,7 +345,13 @@ function remove_user_matrix {
echo "curl -X POST 'https://$MATRIX_DOMAIN_NAME/_matrix/client/r0/admin/deactivate/%40\$remove_username%3A$MATRIX_DOMAIN_NAME?access_token=\$TOKEN' --data '{}'" >> $matrix_remove_user
chmod +x $matrix_remove_user
}
function remove_user_matrix {
remove_username="$1"
create_matrix_user_removal_script
${PROJECT_NAME}-pass -u $remove_username --rmapp matrix
$matrix_remove_user "$remove_username"
}
@ -796,6 +798,7 @@ function install_matrix {
echo $'Failed to add matrix admin user';
exit 879352
fi
create_matrix_user_removal_script
set_completion_param "matrix domain" "$MATRIX_DOMAIN_NAME"