Pushed the scripts :D

This commit is contained in:
2026-04-04 23:47:58 -06:00
parent dd8db693a6
commit f04794a128
2 changed files with 141 additions and 0 deletions
Executable
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# This script deletes a given room
if [ -z "$1" ]; then
echo "Usage: $0 <room_id>"
echo "Environment variables MATRIX_BASE_URL and MATRIX_TOKEN must be set."
exit 1
fi
if [ -z "$MATRIX_BASE_URL" ] || [ -z "$MATRIX_TOKEN" ]; then
echo "Error: MATRIX_BASE_URL and MATRIX_TOKEN environment variables must be set."
exit 1
fi
ROOM_ID="$1"
# Config
export BASE_URL="${MATRIX_BASE_URL}"
export TOKEN="${MATRIX_TOKEN}"
echo "Deleting room $ROOM_ID from server entirely..."
# Delete the room :D
curl -X DELETE "${BASE_URL}/_synapse/admin/v2/rooms/${ROOM_ID}" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"purge": true,
"force_purge": true,
"block": true
}'
echo -e "\nDone."