From 647a406598e19323d2ed951fc17887487dfaa5e0 Mon Sep 17 00:00:00 2001 From: DecaTec Date: Wed, 22 Sep 2021 08:36:26 +0200 Subject: [PATCH] Script for updating room versions --- UpdateRoomVersion.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 UpdateRoomVersion.sh diff --git a/UpdateRoomVersion.sh b/UpdateRoomVersion.sh new file mode 100644 index 0000000..91f5479 --- /dev/null +++ b/UpdateRoomVersion.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# +# Update room version +# + +# Requirements: +# +# For authentication, you will need the access token of your (admin) account. +# You can obtain it in your Element client: "All settings" > "Help & About" > scroll down > click on "" to get your access token. +# Copy this token and paste it further down (variable "token"). +# +# You also need the room ID of the room to update. You can find it in the room's settings under "acvanced" (internal room ID). +# + +token="insert-token-here" +roomId='insert-room-id-here' +newRoomVersion="insert-new-room-version-here" + +# Delete local media +echo "Update room version of room $roomId..." +echo "" +curlUrl="http://localhost:8008/_matrix/client/r0/rooms/$roomId/upgrade?access_token=$token" +curl -X POST $curlUrl -H 'Content-Type: application/json' -d '{"new_version": "'"$newRoomVersion"'"}' +echo "" +echo "Done" +echo "" \ No newline at end of file