Updated scripts. This works a bit better

This commit is contained in:
2026-04-17 09:16:44 -06:00
parent f04794a128
commit fa93db1a5b
3 changed files with 79 additions and 59 deletions
+14 -8
View File
@@ -14,20 +14,26 @@ fi
ROOM_ID="$1"
# Config
export BASE_URL="${MATRIX_BASE_URL}"
export TOKEN="${MATRIX_TOKEN}"
BASE_URL="${MATRIX_BASE_URL}/_synapse/admin/v2"
TOKEN="${MATRIX_TOKEN}"
echo "Deleting room $ROOM_ID from server entirely..."
echo "=== Deleting room $ROOM_ID from server entirely ==="
# Delete the room :D
curl -X DELETE "${BASE_URL}/_synapse/admin/v2/rooms/${ROOM_ID}" \
result=$(curl -s -X DELETE "${BASE_URL}/rooms/${ROOM_ID}" \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"purge": true,
"force_purge": true,
"block": true
}'
}')
echo -e "\nDone."
errcode=$(echo "$result" | jq -r '.errcode // empty' 2>/dev/null)
if [ -n "$errcode" ]; then
echo " Failed: ${errcode} - $(echo "$result" | jq -r '.error // "Unknown"')"
else
echo " Done."
fi
echo ""
echo "Process finished."