README.delete-user: Log in to an instance and store credentials bevor you are able to list/delete/.. user.
This commit is contained in:
parent
52917ecaf4
commit
90d66b870e
@ -61,10 +61,27 @@ usr_to_delete="
|
||||
"
|
||||
|
||||
clear
|
||||
|
||||
# Log in to an instance and store credentials.
|
||||
#
|
||||
# instance url: https://mm-irights.oopen.de
|
||||
# server name: local-server
|
||||
# username: admin-irights
|
||||
# password: M6aHdhGh_I%9
|
||||
|
||||
# save password to a file
|
||||
#
|
||||
cat << EOF > .mm-admin-irights.auth
|
||||
M6aHdhGh_I%9
|
||||
EOF
|
||||
|
||||
mmctl auth login https://mm-irights.oopen.de --name local-server --username admin-irights --password-file .mm-admin-irights.auth
|
||||
|
||||
echo ""
|
||||
for _user in $usr_to_delete ; do
|
||||
echo ""
|
||||
echo $_user
|
||||
|
||||
if $(mmctl user list 2> /dev/null | grep -q $_user) ; then
|
||||
echo -n " Delete user '$_user' [yes/no]: "
|
||||
read OK
|
||||
@ -94,6 +111,9 @@ for _user in $usr_to_delete ; do
|
||||
fi
|
||||
done
|
||||
|
||||
rm .mm-admin-irights.auth
|
||||
|
||||
|
||||
# Set "EnableAPIUserDeletion" to "false" in file /opt/mattermost/config/config.json
|
||||
#
|
||||
perl -i -n -p -e "s/^(\s*\"EnableAPIUserDeletion\":).*$/\1 false,/" /opt/mattermost/config/config.json
|
||||
|
Loading…
Reference in New Issue
Block a user