diff --git a/ListAllUsers.sh b/GetAllUsers.sh similarity index 100% rename from ListAllUsers.sh rename to GetAllUsers.sh diff --git a/GetMatrixSynapseVersion.sh b/GetMatrixSynapseVersion.sh new file mode 100755 index 0000000..68e7ab6 --- /dev/null +++ b/GetMatrixSynapseVersion.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# +# Gets the version of a Matrix Synapse installation +# + +# The following variables have to be set individually. +serverDomain="matrix.mydomain.com" + +echo "Getting version..." +echo "" +curlUrl="https://$serverDomain/_matrix/federation/v1/version" +version=$(curl -sS $curlUrl | grep '"version":' | sed -E 's/.*"([^"]+)".*/\1/') +echo "Matrix Synapse version: $version" +echo "" +echo "Done" +echo "" diff --git a/README.md b/README.md index f7163c9..ada065c 100644 --- a/README.md +++ b/README.md @@ -6,5 +6,6 @@ Some useful scripts utilizing the API of Matrix Synapse in order to manage diffe * `CleanupMedia.sh`: Deletes old local and remote media. * `DeactivateUser.sh`: Deactivates the given user. * `GetAccessToken.sh`: Gets the access token with curl. -* `ListAllUsers.sh`: Lists all users. +* `GetAllUsers.sh`: Lists all users. +* `GetMatrixSynapseVersion.sh`: Gets the version of a Matrix Synapse instance. * `UpdateRoomVersion.sh`: Updates a room to the given room version. \ No newline at end of file