Replies: 2 comments
-
@xBr0th3rx There is no need for confirmation when using the API, so if it's a viable use case to you, you could use the API instead. Here is a small Bash script to delete multiple devices by their GUID. #!/bin/env bash
set -euo pipefail
readonly api_url='https://rustdesk.example.com/api'
readonly api_auth_token='Foo/Bar_Secret=='
# Device GUIDs can be found in the device's detailed panel (the one that opens when clicking on the ID from the "Device List" table)
device_guids=(
'3fb92280-59bc-93b5-8593-687efe41356f'
# …
)
for device_guid in "${device_guids[@]}" ; do
# Disable
curl \
--dump-header /dev/stderr \
--output - \
--silent \
-X PUT \
--url "${api_url}/enable-peers" \
-H "Authorization: Bearer ${api_auth_token}" \
-H 'Content-Type: application/json' \
--data-raw '{"rows":["'${device_guid}'"],"disable":true}'
# Delete
curl \
--dump-header /dev/stderr \
--output - \
--silent \
-X DELETE \
--url "${api_url}/devices/${device_guid}" \
-H "Authorization: Bearer ${api_auth_token}"
done Possible modifications of the script:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to delete a whole lot of devices at once? because clicking Delete and entering the ID as confirmation each time is annoying.
Greetings
Beta Was this translation helpful? Give feedback.
All reactions