add matrix-tombstone-room.bash

This commit is contained in:
Aminda Suomalainen 2020-02-11 20:01:32 +02:00
parent df18e0b031
commit 64d81b0340
Signed by: Mikaela
GPG Key ID: 99392F62BAE30723
1 changed files with 14 additions and 0 deletions

14
bash/matrix-tombstone-room.bash Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# This is just step 3 from https://gist.github.com/turt2live/a99c8e794d6115d4ddfaadb72aabf063
# which is the one I have a need to perform the most as I have ended up with
# some duplicate rooms.
ACCESSTOKEN=
OLDROOMID=
NEWROOMID=
HOMESERVER=chat.privacytools.io
set -x
curl -s -X PUT -H "Authorization: Bearer $ACCESSTOKEN" -H "Content-Type: application/json" --data-binary "{\"replacement_room\":\"$NEWROOMID\"}" "https://$HOMESERVER/_matrix/client/r0/rooms/$OLDROOMID/state/m.room.tombstone"
set +x