25 lines
431 B
Bash
Executable File
25 lines
431 B
Bash
Executable File
#!/bin/bash
|
|
|
|
usage() {
|
|
echo "Not enough arguments supplied."
|
|
echo "Syntax: $(basename $0) {username}"
|
|
echo
|
|
}
|
|
|
|
if [[ $# -lt 1 ]]; then
|
|
usage
|
|
exit 1
|
|
fi
|
|
|
|
. $(dirname $0)/auth
|
|
|
|
USER=$1
|
|
|
|
curl -s --insecure -X GET \
|
|
-H "Authorization: Bearer $TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{}' "http://localhost:8008/_synapse/admin/v2/users/@$USER:matrix.erb.pw" | \
|
|
sed 's/,/,\n /g; s/{/{\n /g; s/}/\n}/g'
|
|
|
|
echo
|